Update zrpc vs zrpcunsafe logging in z_sendmany operation
This commit is contained in:
@@ -805,7 +805,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
// Special case: if debug=zrpcunsafe, implies debug=zrpc, so add it to debug categories
|
// Special case: if debug=zrpcunsafe, implies debug=zrpc, so add it to debug categories
|
||||||
if (find(categories.begin(), categories.end(), string("zrpcunsafe")) != categories.end()) {
|
if (find(categories.begin(), categories.end(), string("zrpcunsafe")) != categories.end()) {
|
||||||
if (find(categories.begin(), categories.end(), string("zrpc")) == categories.end()) {
|
if (find(categories.begin(), categories.end(), string("zrpc")) == categories.end()) {
|
||||||
LogPrintf("%s: parameter interaction: -debug=zrpcunsafe -> -debug=zrpc\n", __func__);
|
LogPrintf("%s: parameter interaction: setting -debug=zrpcunsafe -> -debug=zrpc\n", __func__);
|
||||||
vector<string>& v = mapMultiArgs["-debug"];
|
vector<string>& v = mapMultiArgs["-debug"];
|
||||||
v.push_back("zrpc");
|
v.push_back("zrpc");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -276,13 +276,13 @@ bool AsyncRPCOperation_sendmany::main_impl() {
|
|||||||
tx_ = CTransaction(rawTx);
|
tx_ = CTransaction(rawTx);
|
||||||
}
|
}
|
||||||
|
|
||||||
LogPrint("zrpc", "%s: spending %s to send %s with fee %s\n",
|
LogPrint((isfromtaddr_) ? "zrpc" : "zrpcunsafe", "%s: spending %s to send %s with fee %s\n",
|
||||||
getId(), FormatMoney(targetAmount, false), FormatMoney(sendAmount, false), FormatMoney(minersFee, false));
|
getId(), FormatMoney(targetAmount, false), FormatMoney(sendAmount, false), FormatMoney(minersFee, false));
|
||||||
LogPrint("zrpc", "%s: - transparent input: %s (to choose from)\n", getId(), FormatMoney(t_inputs_total, false));
|
LogPrint("zrpc", "%s: transparent input: %s (to choose from)\n", getId(), FormatMoney(t_inputs_total, false));
|
||||||
LogPrint("zrpc", "%s: - private input: %s (to choose from)\n", getId(), FormatMoney(z_inputs_total, false));
|
LogPrint("zrpcunsafe", "%s: private input: %s (to choose from)\n", getId(), FormatMoney(z_inputs_total, false));
|
||||||
LogPrint("zrpc", "%s: - transparent output: %s\n", getId(), FormatMoney(t_outputs_total, false));
|
LogPrint("zrpc", "%s: transparent output: %s\n", getId(), FormatMoney(t_outputs_total, false));
|
||||||
LogPrint("zrpc", "%s: - private output: %s\n", getId(), FormatMoney(z_outputs_total, false));
|
LogPrint("zrpcunsafe", "%s: private output: %s\n", getId(), FormatMoney(z_outputs_total, false));
|
||||||
LogPrint("zrpc", "%s: - fee: %s\n", getId(), FormatMoney(minersFee, false));
|
LogPrint("zrpc", "%s: fee: %s\n", getId(), FormatMoney(minersFee, false));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SCENARIO #1
|
* SCENARIO #1
|
||||||
@@ -467,7 +467,7 @@ bool AsyncRPCOperation_sendmany::main_impl() {
|
|||||||
wtxHeight = mapBlockIndex[wtx.hashBlock]->nHeight;
|
wtxHeight = mapBlockIndex[wtx.hashBlock]->nHeight;
|
||||||
wtxDepth = wtx.GetDepthInMainChain();
|
wtxDepth = wtx.GetDepthInMainChain();
|
||||||
}
|
}
|
||||||
LogPrint("zrpc", "%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, ciphertext=%d, amount=%s, height=%d, confirmations=%d)\n",
|
||||||
getId(),
|
getId(),
|
||||||
outPoint.hash.ToString().substr(0, 10),
|
outPoint.hash.ToString().substr(0, 10),
|
||||||
outPoint.js,
|
outPoint.js,
|
||||||
@@ -496,7 +496,7 @@ bool AsyncRPCOperation_sendmany::main_impl() {
|
|||||||
info.vjsout.push_back(JSOutput());
|
info.vjsout.push_back(JSOutput());
|
||||||
info.vjsout.push_back(JSOutput(frompaymentaddress_, jsChange));
|
info.vjsout.push_back(JSOutput(frompaymentaddress_, jsChange));
|
||||||
|
|
||||||
LogPrint("zrpc", "%s: generating note for change (amount=%s)\n",
|
LogPrint("zrpcunsafe", "%s: generating note for change (amount=%s)\n",
|
||||||
getId(),
|
getId(),
|
||||||
FormatMoney(jsChange, false)
|
FormatMoney(jsChange, false)
|
||||||
);
|
);
|
||||||
@@ -592,7 +592,7 @@ bool AsyncRPCOperation_sendmany::main_impl() {
|
|||||||
|
|
||||||
jsInputValue += plaintext.value;
|
jsInputValue += plaintext.value;
|
||||||
|
|
||||||
LogPrint("zrpc", "%s: spending change (amount=%s)\n",
|
LogPrint("zrpcunsafe", "%s: spending change (amount=%s)\n",
|
||||||
getId(),
|
getId(),
|
||||||
FormatMoney(plaintext.value, false)
|
FormatMoney(plaintext.value, false)
|
||||||
);
|
);
|
||||||
@@ -639,7 +639,7 @@ bool AsyncRPCOperation_sendmany::main_impl() {
|
|||||||
wtxHeight = mapBlockIndex[wtx.hashBlock]->nHeight;
|
wtxHeight = mapBlockIndex[wtx.hashBlock]->nHeight;
|
||||||
wtxDepth = wtx.GetDepthInMainChain();
|
wtxDepth = wtx.GetDepthInMainChain();
|
||||||
}
|
}
|
||||||
LogPrint("zrpc", "%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, ciphertext=%d, amount=%s, height=%d, confirmations=%d)\n",
|
||||||
getId(),
|
getId(),
|
||||||
jso.hash.ToString().substr(0, 10),
|
jso.hash.ToString().substr(0, 10),
|
||||||
jso.js,
|
jso.js,
|
||||||
@@ -734,7 +734,7 @@ bool AsyncRPCOperation_sendmany::main_impl() {
|
|||||||
if (jsChange>0) {
|
if (jsChange>0) {
|
||||||
info.vjsout.push_back(JSOutput(frompaymentaddress_, jsChange));
|
info.vjsout.push_back(JSOutput(frompaymentaddress_, jsChange));
|
||||||
|
|
||||||
LogPrint("zrpc", "%s: generating note for change (amount=%s)\n",
|
LogPrint("zrpcunsafe", "%s: generating note for change (amount=%s)\n",
|
||||||
getId(),
|
getId(),
|
||||||
FormatMoney(jsChange, false)
|
FormatMoney(jsChange, false)
|
||||||
);
|
);
|
||||||
@@ -869,24 +869,14 @@ bool AsyncRPCOperation_sendmany::find_unspent_notes() {
|
|||||||
for (CNotePlaintextEntry & entry : entries) {
|
for (CNotePlaintextEntry & entry : entries) {
|
||||||
z_inputs_.push_back(SendManyInputJSOP(entry.jsop, entry.plaintext.note(frompaymentaddress_), CAmount(entry.plaintext.value)));
|
z_inputs_.push_back(SendManyInputJSOP(entry.jsop, entry.plaintext.note(frompaymentaddress_), CAmount(entry.plaintext.value)));
|
||||||
std::string data(entry.plaintext.memo.begin(), entry.plaintext.memo.end());
|
std::string data(entry.plaintext.memo.begin(), entry.plaintext.memo.end());
|
||||||
if (LogAcceptCategory("zrpcunsafe")) {
|
LogPrint("zrpcunsafe", "%s: found unspent note (txid=%s, vjoinsplit=%d, ciphertext=%d, amount=%s, memo=%s)\n",
|
||||||
LogPrint("zrpcunsafe", "%s: found unspent note (txid=%s, vjoinsplit=%d, ciphertext=%d, amount=%s, memo=%s)\n",
|
getId(),
|
||||||
getId(),
|
entry.jsop.hash.ToString().substr(0, 10),
|
||||||
entry.jsop.hash.ToString().substr(0, 10),
|
entry.jsop.js,
|
||||||
entry.jsop.js,
|
int(entry.jsop.n), // uint8_t
|
||||||
int(entry.jsop.n), // uint8_t
|
FormatMoney(entry.plaintext.value, false),
|
||||||
FormatMoney(entry.plaintext.value, false),
|
HexStr(data).substr(0, 10)
|
||||||
HexStr(data).substr(0, 10)
|
);
|
||||||
);
|
|
||||||
} else {
|
|
||||||
LogPrint("zrpc", "%s: found unspent note (txid=%s, vjoinsplit=%d, ciphertext=%d, amount=%s)\n",
|
|
||||||
getId(),
|
|
||||||
entry.jsop.hash.ToString().substr(0, 10),
|
|
||||||
entry.jsop.js,
|
|
||||||
int(entry.jsop.n), // uint8_t
|
|
||||||
FormatMoney(entry.plaintext.value, false)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (z_inputs_.size() == 0) {
|
if (z_inputs_.size() == 0) {
|
||||||
@@ -957,7 +947,7 @@ Object AsyncRPCOperation_sendmany::perform_joinsplit(
|
|||||||
|
|
||||||
CMutableTransaction mtx(tx_);
|
CMutableTransaction mtx(tx_);
|
||||||
|
|
||||||
LogPrint("zrpc", "%s: creating joinsplit at index %d (vpub_old=%s, vpub_new=%s, in[0]=%s, in[1]=%s, out[0]=%s, out[1]=%s)\n",
|
LogPrint("zrpcunsafe", "%s: creating joinsplit at index %d (vpub_old=%s, vpub_new=%s, in[0]=%s, in[1]=%s, out[0]=%s, out[1]=%s)\n",
|
||||||
getId(),
|
getId(),
|
||||||
tx_.vjoinsplit.size(),
|
tx_.vjoinsplit.size(),
|
||||||
FormatMoney(info.vpub_old, false), FormatMoney(info.vpub_new, false),
|
FormatMoney(info.vpub_old, false), FormatMoney(info.vpub_new, false),
|
||||||
|
|||||||
Reference in New Issue
Block a user