diff options
Diffstat (limited to 'src/wallet/rpc/util.cpp')
-rw-r--r-- | src/wallet/rpc/util.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/wallet/rpc/util.cpp b/src/wallet/rpc/util.cpp index 4d82e0a41f..4ff44b84b0 100644 --- a/src/wallet/rpc/util.cpp +++ b/src/wallet/rpc/util.cpp @@ -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 |