mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-02 20:05:45 +02:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user