Add -zdebug to more stuff
This commit is contained in:
@@ -465,7 +465,8 @@ bool AsyncRPCOperation_sendmany::main_impl() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Select Sapling notes
|
// Select Sapling notes
|
||||||
LogPrintf("%s: Selecting Sapling notes\n", __FUNCTION__);
|
if(fZdebug)
|
||||||
|
LogPrintf("%s: Selecting Sapling notes\n", __FUNCTION__);
|
||||||
std::vector<SaplingOutPoint> ops;
|
std::vector<SaplingOutPoint> ops;
|
||||||
std::vector<SaplingNote> notes;
|
std::vector<SaplingNote> notes;
|
||||||
CAmount sum = 0;
|
CAmount sum = 0;
|
||||||
@@ -504,7 +505,8 @@ bool AsyncRPCOperation_sendmany::main_impl() {
|
|||||||
auto addr = DecodePaymentAddress(address);
|
auto addr = DecodePaymentAddress(address);
|
||||||
assert(boost::get<libzcash::SaplingPaymentAddress>(&addr) != nullptr);
|
assert(boost::get<libzcash::SaplingPaymentAddress>(&addr) != nullptr);
|
||||||
auto to = boost::get<libzcash::SaplingPaymentAddress>(addr);
|
auto to = boost::get<libzcash::SaplingPaymentAddress>(addr);
|
||||||
LogPrintf("%s: Adding Sapling output to address %s\n", __FUNCTION__, to.GetHash().ToString().c_str());
|
if(fZdebug)
|
||||||
|
LogPrintf("%s: Adding Sapling output to address %s\n", __FUNCTION__, to.GetHash().ToString().c_str());
|
||||||
|
|
||||||
auto memo = get_memo_from_hex_string(hexMemo);
|
auto memo = get_memo_from_hex_string(hexMemo);
|
||||||
|
|
||||||
@@ -528,7 +530,8 @@ bool AsyncRPCOperation_sendmany::main_impl() {
|
|||||||
throw JSONRPCError(RPC_WALLET_ERROR, "Failed to build transaction.");
|
throw JSONRPCError(RPC_WALLET_ERROR, "Failed to build transaction.");
|
||||||
}
|
}
|
||||||
tx_ = maybe_tx.get();
|
tx_ = maybe_tx.get();
|
||||||
LogPrintf("%s: Raw transaction created\n", __FUNCTION__);
|
if(fZdebug)
|
||||||
|
LogPrintf("%s: Raw transaction created\n", __FUNCTION__);
|
||||||
|
|
||||||
// Send the transaction
|
// Send the transaction
|
||||||
// TODO: Use CWallet::CommitTransaction instead of sendrawtransaction
|
// TODO: Use CWallet::CommitTransaction instead of sendrawtransaction
|
||||||
@@ -536,7 +539,8 @@ bool AsyncRPCOperation_sendmany::main_impl() {
|
|||||||
if (!testmode) {
|
if (!testmode) {
|
||||||
UniValue params = UniValue(UniValue::VARR);
|
UniValue params = UniValue(UniValue::VARR);
|
||||||
params.push_back(signedtxn);
|
params.push_back(signedtxn);
|
||||||
LogPrintf("%s: Sending raw xtn\n", __FUNCTION__);
|
if(fZdebug)
|
||||||
|
LogPrintf("%s: Sending raw xtn with txid=\n", __FUNCTION__, tx_.GetHash().ToString().c_str());
|
||||||
UniValue sendResultValue = sendrawtransaction(params, false, CPubKey());
|
UniValue sendResultValue = sendrawtransaction(params, false, CPubKey());
|
||||||
if (sendResultValue.isNull()) {
|
if (sendResultValue.isNull()) {
|
||||||
throw JSONRPCError(RPC_WALLET_ERROR, "sendrawtransaction did not return an error or a txid.");
|
throw JSONRPCError(RPC_WALLET_ERROR, "sendrawtransaction did not return an error or a txid.");
|
||||||
|
|||||||
@@ -4592,7 +4592,8 @@ UniValue z_sendmany(const UniValue& params, bool fHelp, const CPubKey& mypk)
|
|||||||
|
|
||||||
// As a sanity check, estimate and verify that the size of the transaction will be valid.
|
// As a sanity check, estimate and verify that the size of the transaction will be valid.
|
||||||
// Depending on the input notes, the actual tx size may turn out to be larger and perhaps invalid.
|
// Depending on the input notes, the actual tx size may turn out to be larger and perhaps invalid.
|
||||||
LogPrintf("%s: Verifying xtn size is valid\n", __FUNCTION__);
|
if(fZdebug)
|
||||||
|
LogPrintf("%s: Verifying xtn size is valid\n", __FUNCTION__);
|
||||||
size_t txsize = 0;
|
size_t txsize = 0;
|
||||||
for (int i = 0; i < zaddrRecipients.size(); i++) {
|
for (int i = 0; i < zaddrRecipients.size(); i++) {
|
||||||
auto address = std::get<0>(zaddrRecipients[i]);
|
auto address = std::get<0>(zaddrRecipients[i]);
|
||||||
@@ -4657,7 +4658,8 @@ UniValue z_sendmany(const UniValue& params, bool fHelp, const CPubKey& mypk)
|
|||||||
o.push_back(Pair("minconf", nMinDepth));
|
o.push_back(Pair("minconf", nMinDepth));
|
||||||
o.push_back(Pair("fee", std::stod(FormatMoney(nFee))));
|
o.push_back(Pair("fee", std::stod(FormatMoney(nFee))));
|
||||||
UniValue contextInfo = o;
|
UniValue contextInfo = o;
|
||||||
LogPrintf("%s: Building the transaction\n", __FUNCTION__);
|
if(fZdebug)
|
||||||
|
LogPrintf("%s: Building the raw ztransaction\n", __FUNCTION__);
|
||||||
|
|
||||||
// Builder (used if Sapling addresses are involved)
|
// Builder (used if Sapling addresses are involved)
|
||||||
boost::optional<TransactionBuilder> builder;
|
boost::optional<TransactionBuilder> builder;
|
||||||
@@ -4677,7 +4679,8 @@ UniValue z_sendmany(const UniValue& params, bool fHelp, const CPubKey& mypk)
|
|||||||
std::shared_ptr<AsyncRPCQueue> q = getAsyncRPCQueue();
|
std::shared_ptr<AsyncRPCQueue> q = getAsyncRPCQueue();
|
||||||
std::shared_ptr<AsyncRPCOperation> operation( new AsyncRPCOperation_sendmany(builder, contextualTx, fromaddress, taddrRecipients, zaddrRecipients, nMinDepth, nFee, contextInfo) );
|
std::shared_ptr<AsyncRPCOperation> operation( new AsyncRPCOperation_sendmany(builder, contextualTx, fromaddress, taddrRecipients, zaddrRecipients, nMinDepth, nFee, contextInfo) );
|
||||||
q->addOperation(operation);
|
q->addOperation(operation);
|
||||||
LogPrintf("%s: Submitted to queue\n", __FUNCTION__);
|
if(fZdebug)
|
||||||
|
LogPrintf("%s: Submitted to async queue\n", __FUNCTION__);
|
||||||
AsyncRPCOperationId operationId = operation->getId();
|
AsyncRPCOperationId operationId = operation->getId();
|
||||||
return operationId;
|
return operationId;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user