Skip to content

Commit

Permalink
Fix LogPrint statements
Browse files Browse the repository at this point in the history
  • Loading branch information
Eirik0 committed May 10, 2019
1 parent 58348c7 commit 23d9826
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
5 changes: 3 additions & 2 deletions qa/rpc-tests/sprout_sapling_migration.py
Expand Up @@ -45,9 +45,10 @@ def setup_nodes(self):
# Add migration parameters to nodes[0]
extra_args[0] = extra_args[0] + [
'-migration',
'-migrationdestaddress=' + SAPLING_ADDR
'-migrationdestaddress=' + SAPLING_ADDR,
'-debug=zrpcunsafe'
]
assert_equal(4, len(extra_args[0]))
assert_equal(5, len(extra_args[0]))
assert_equal(2, len(extra_args[1]))
return start_nodes(4, self.options.tmpdir, extra_args)

Expand Down
2 changes: 1 addition & 1 deletion src/wallet/asyncrpcoperation_mergetoaddress.cpp
Expand Up @@ -645,7 +645,7 @@ bool AsyncRPCOperation_mergetoaddress::main_impl()
wtxHeight = mapBlockIndex[wtx.hashBlock]->nHeight;
wtxDepth = wtx.GetDepthInMainChain();
}
LogPrint("zrpcunsafe", "%s: spending note (txid=%s, vjoinsplit=%d, ciphertext=%d, amount=%s, height=%d, confirmations=%d)\n",
LogPrint("zrpcunsafe", "%s: spending note (txid=%s, vjoinsplit=%d, jsoutindex=%d, amount=%s, height=%d, confirmations=%d)\n",
getId(),
jso.hash.ToString().substr(0, 10),
jso.js,
Expand Down
8 changes: 4 additions & 4 deletions src/wallet/asyncrpcoperation_saplingmigration.cpp
Expand Up @@ -68,7 +68,7 @@ void AsyncRPCOperation_saplingmigration::main() {
}

bool AsyncRPCOperation_saplingmigration::main_impl() {
LogPrint("zrpcunsafe", "Beginning AsyncRPCOperation_saplingmigration. id=%s\n", getId());
LogPrint("zrpcunsafe", "%s: Beginning AsyncRPCOperation_saplingmigration.\n", getId());
std::vector<CSproutNotePlaintextEntry> sproutEntries;
std::vector<SaplingNoteEntry> saplingEntries;
{
Expand Down Expand Up @@ -105,7 +105,7 @@ bool AsyncRPCOperation_saplingmigration::main_impl() {
CAmount amountToSend = chooseAmount(availableFunds);
auto builder = TransactionBuilder(consensusParams, targetHeight_, MIGRATION_EXPIRY_DELTA, pwalletMain, pzcashParams,
&coinsView, &cs_main);
LogPrint("zrpcunsafe", "%s: Beginning creating transaction with Sapling output amount=%s\n", getId(), amountToSend - FEE);
LogPrint("zrpcunsafe", "%s: Beginning creating transaction with Sapling output amount=%s\n", getId(), FormatMoney(amountToSend - FEE));
std::vector<CSproutNotePlaintextEntry> fromNotes;
CAmount fromNoteAmount = 0;
while (fromNoteAmount < amountToSend) {
Expand All @@ -116,7 +116,7 @@ bool AsyncRPCOperation_saplingmigration::main_impl() {
availableFunds -= fromNoteAmount;
for (const CSproutNotePlaintextEntry& sproutEntry : fromNotes) {
std::string data(sproutEntry.plaintext.memo().begin(), sproutEntry.plaintext.memo().end());
LogPrint("zrpcunsafe", "%s: Adding Sprout note input (txid=%s, vjoinsplit=%d, ciphertext=%d, amount=%s, memo=%s)\n",
LogPrint("zrpcunsafe", "%s: Adding Sprout note input (txid=%s, vjoinsplit=%d, jsoutindex=%d, amount=%s, memo=%s)\n",
getId(),
sproutEntry.jsop.hash.ToString().substr(0, 10),
sproutEntry.jsop.js,
Expand All @@ -142,7 +142,7 @@ bool AsyncRPCOperation_saplingmigration::main_impl() {
builder.AddSaplingOutput(ovkForShieldingFromTaddr(seed), migrationDestAddress, amountToSend - FEE);
CTransaction tx = builder.Build().GetTxOrThrow();
if (isCancelled()) {
LogPrint("zrpcunsafe", "%s: Canceled. Stopping.\n");
LogPrint("zrpcunsafe", "%s: Canceled. Stopping.\n", getId());
break;
}
pwalletMain->AddPendingSaplingMigrationTx(tx);
Expand Down
4 changes: 2 additions & 2 deletions src/wallet/asyncrpcoperation_sendmany.cpp
Expand Up @@ -784,7 +784,7 @@ bool AsyncRPCOperation_sendmany::main_impl() {
wtxHeight = mapBlockIndex[wtx.hashBlock]->nHeight;
wtxDepth = wtx.GetDepthInMainChain();
}
LogPrint("zrpcunsafe", "%s: spending note (txid=%s, vjoinsplit=%d, ciphertext=%d, amount=%s, height=%d, confirmations=%d)\n",
LogPrint("zrpcunsafe", "%s: spending note (txid=%s, vjoinsplit=%d, jsoutindex=%d, amount=%s, height=%d, confirmations=%d)\n",
getId(),
jso.hash.ToString().substr(0, 10),
jso.js,
Expand Down Expand Up @@ -1048,7 +1048,7 @@ bool AsyncRPCOperation_sendmany::find_unspent_notes() {
for (CSproutNotePlaintextEntry & entry : sproutEntries) {
z_sprout_inputs_.push_back(SendManyInputJSOP(entry.jsop, entry.plaintext.note(boost::get<libzcash::SproutPaymentAddress>(frompaymentaddress_)), CAmount(entry.plaintext.value())));
std::string data(entry.plaintext.memo().begin(), entry.plaintext.memo().end());
LogPrint("zrpcunsafe", "%s: found unspent Sprout note (txid=%s, vjoinsplit=%d, ciphertext=%d, amount=%s, memo=%s)\n",
LogPrint("zrpcunsafe", "%s: found unspent Sprout note (txid=%s, vjoinsplit=%d, jsoutindex=%d, amount=%s, memo=%s)\n",
getId(),
entry.jsop.hash.ToString().substr(0, 10),
entry.jsop.js,
Expand Down

0 comments on commit 23d9826

Please sign in to comment.