Compare commits

...

3 Commits

Author SHA1 Message Date
Duke
aa5cbee69c Remove dead code 2023-09-18 20:57:47 -04:00
Duke
d7cbdcab28 Always log when skipping a zaddr during z_importwallet 2023-09-18 20:44:16 -04:00
Duke
09555fbee2 Allow abortrescan during RPC warmup
If we don't, we can get the hilarious error message that the node is Rescanning...
when trying to run abortrescan when the node automatically does a rescan on boot.
2023-09-18 12:43:27 -04:00
3 changed files with 5 additions and 5 deletions

View File

@ -1863,8 +1863,6 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
view.GetBestBlock(); view.GetBestBlock();
nValueIn = view.GetValueIn(chainActive.LastTip()->GetHeight(),&interest,tx,chainActive.LastTip()->nTime); nValueIn = view.GetValueIn(chainActive.LastTip()->GetHeight(),&interest,tx,chainActive.LastTip()->nTime);
if ( 0 && interest != 0 )
fprintf(stderr,"add interest %.8f\n",(double)interest/COIN);
// we have all inputs cached now, so switch back to dummy, so we don't need to keep lock on mempool // we have all inputs cached now, so switch back to dummy, so we don't need to keep lock on mempool
view.SetBackend(dummy); view.SetBackend(dummy);
} }

View File

@ -832,7 +832,8 @@ UniValue CRPCTable::execute(const std::string &strMethod, const UniValue &params
pcmd->name != "getnotarysendmany" && pcmd->name != "geterablockheights" && pcmd->name != "getnotarysendmany" && pcmd->name != "geterablockheights" &&
pcmd->name != "getaddressesbyaccount" && pcmd->name != "listaddresses" && pcmd->name != "z_exportwallet" && pcmd->name != "getaddressesbyaccount" && pcmd->name != "listaddresses" && pcmd->name != "z_exportwallet" &&
pcmd->name != "notaries" && pcmd->name != "signmessage" && pcmd->name != "decoderawtransaction" && pcmd->name != "notaries" && pcmd->name != "signmessage" && pcmd->name != "decoderawtransaction" &&
pcmd->name != "dumpprivkey" && pcmd->name != "getpeerinfo" && pcmd->name != "getnetworkinfo" ) { pcmd->name != "dumpprivkey" && pcmd->name != "getpeerinfo" && pcmd->name != "getnetworkinfo" &&
pcmd->name != "abortrescan") {
throw JSONRPCError(RPC_IN_WARMUP, rpcWarmupStatus); throw JSONRPCError(RPC_IN_WARMUP, rpcWarmupStatus);
} }
} }

View File

@ -515,14 +515,15 @@ UniValue importwallet_impl(const UniValue& params, bool fHelp, bool fImportZKeys
auto addResult = boost::apply_visitor( auto addResult = boost::apply_visitor(
AddSpendingKeyToWallet(pwalletMain, Params().GetConsensus(), nTime, hdKeypath, seedFpStr, true), spendingkey); AddSpendingKeyToWallet(pwalletMain, Params().GetConsensus(), nTime, hdKeypath, seedFpStr, true), spendingkey);
if (addResult == KeyAlreadyExists){ if (addResult == KeyAlreadyExists){
LogPrint("zrpc", "Skipping import of zaddr (key already present)\n"); LogPrintf("%s: Skipping import of zaddr (key already present)\n", __func__);
} else if (addResult == KeyNotAdded) { } else if (addResult == KeyNotAdded) {
// Something went wrong // Something went wrong
fGood = false; fGood = false;
LogPrintf("%s: Skipping import of zaddr (something went wrong)\n", __func__);
} }
continue; continue;
} else { } else {
LogPrint("zrpc", "Importing detected an error: invalid spending key. Trying as a transparent key...\n"); LogPrintf("%s: Importing detected an error: invalid spending key. Trying as a transparent key...\n",__func__);
// Not a valid spending key, so carry on and see if it's a Hush transparent address // Not a valid spending key, so carry on and see if it's a Hush transparent address
} }
} }