1
0
Fork 0
forked from lthn/blockchain

useful warnings and other logging improvements

This commit is contained in:
sowle 2023-06-03 04:05:12 +02:00
parent 2aa302f69a
commit 30a54790a6
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC
3 changed files with 10 additions and 5 deletions

View file

@ -94,10 +94,11 @@ bool transition_convert(const transaction_current_t& from, transaction_v1& to)
{
if (s.type() == typeid(NLSAG_sig))
{
to.signatures.push_back(boost::get<NLSAG_sig>(s).s); ;
}else
to.signatures.push_back(boost::get<NLSAG_sig>(s).s);
}
else
{
throw std::runtime_error("Unexpected type in signature_v");
throw std::runtime_error(std::string("Unexpected type in tx.signatures during transition_convert: ") + s.type().name());
}
}
return true;

View file

@ -2224,6 +2224,10 @@ namespace currency
}
}
if (zc_inputs_count != 0 && tx.version <= TRANSACTION_VERSION_PRE_HF4)
{
LOG_PRINT_YELLOW("WARNING: tx v1 should not use ZC inputs", LOG_LEVEL_0);
}
//
// OUTs

View file

@ -945,8 +945,8 @@ namespace currency
return "(no transactions, the pool is empty)";
// sort output by receive time
txs.sort([](const std::pair<crypto::hash, tx_details>& lhs, const std::pair<crypto::hash, tx_details>& rhs) -> bool { return lhs.second.receive_time < rhs.second.receive_time; });
ss << "# | transaction id | size | fee | ins | outs | outs money | live_time | max used block | last failed block | kept by a block?" << ENDL;
// 1234 <f99fe6d4335fc0ddd69e6880a4d95e0f6ea398de0324a6837021a61c6a31cacd> 87157 0.10000111 2000 2000 112000.12345678 d0.h10.m16.s17 123456 <12345..> 123456 <12345..> YES
ss << "# | transaction id | size | fee | ins | outs | outs money | live_time | max used block | last failed block | kept by a block?" << ENDL;
// 1234 f99fe6d4335fc0ddd69e6880a4d95e0f6ea398de0324a6837021a61c6a31cacd 87157 0.10000111 2000 2000 112000.12345678 d0.h10.m16.s17 123456 <12345..> 123456 <12345..> YES
size_t i = 0;
for (auto& tx : txs)
{