rpc: return block hash & height in getbalances, gettransaction & getwalletinfo JSONs

Co-authored-by: Aurèle Oulès <aurele@oules.com>
This commit is contained in:
Harris
2020-04-27 10:45:03 +02:00
committed by Aurèle Oulès
parent 91ccb62faa
commit 710b83938a
9 changed files with 70 additions and 6 deletions

View File

@@ -177,4 +177,14 @@ void HandleWalletError(const std::shared_ptr<CWallet> wallet, DatabaseStatus& st
throw JSONRPCError(code, error.original);
}
}
void AppendLastProcessedBlock(UniValue& entry, const CWallet& wallet) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)
{
AssertLockHeld(wallet.cs_wallet);
UniValue lastprocessedblock{UniValue::VOBJ};
lastprocessedblock.pushKV("hash", wallet.GetLastBlockHash().GetHex());
lastprocessedblock.pushKV("height", wallet.GetLastBlockHeight());
entry.pushKV("lastprocessedblock", lastprocessedblock);
}
} // namespace wallet