aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/rpcwallet.cpp
diff options
context:
space:
mode:
authorSamuel Dobson <dobsonsa68@gmail.com>2020-10-20 12:33:13 +1300
committerSamuel Dobson <dobsonsa68@gmail.com>2020-10-20 12:35:33 +1300
commitf5bd46a4cc6d395ce71ecb99852c1774235a249c (patch)
treea512e9bcd9eb2185cdfa299877633bee8016daa9 /src/wallet/rpcwallet.cpp
parent45385018e13e167521e655c36128d8ee4f2a3e0b (diff)
parent624bab00dd2cc8e2ebd77dc0a669bc8d507c3721 (diff)
downloadbitcoin-f5bd46a4cc6d395ce71ecb99852c1774235a249c.tar.xz
Merge #20125: rpc, wallet: Expose database format in getwalletinfo
624bab00dd2cc8e2ebd77dc0a669bc8d507c3721 test: add coverage for getwalletinfo format field (Jon Atack) 5e737a009234cbd7cf53748d3d28a2da5221192f rpc, wallet: Expose database format in getwalletinfo (João Barbosa) Pull request description: Support for sqlite based wallets was added in #19077. This PR adds the `format` key in `getwalletinfo` response, that can be `bdb` or `sqlite`. ACKs for top commit: jonatack: Tested ACK 624bab00dd2cc8e2ebd77dc0a669bc8d507c3721 laanwj: Code review ACK 624bab00dd2cc8e2ebd77dc0a669bc8d507c3721. MarcoFalke: doesn't hurt ACK 624bab00dd2cc8e2ebd77dc0a669bc8d507c3721 hebasto: ACK 624bab00dd2cc8e2ebd77dc0a669bc8d507c3721, tested on Linux Mint 20 (x86_64). meshcollider: utACK 624bab00dd2cc8e2ebd77dc0a669bc8d507c3721 Tree-SHA512: a81f8530f040f6381d33e073a65f281993eccfa717424ab6e651c1203cbaf27794dcb7175570459e7fdaa211565bc060d0a3ecbe70d2b6f9c49b8d5071e4441c
Diffstat (limited to 'src/wallet/rpcwallet.cpp')
-rw-r--r--src/wallet/rpcwallet.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
index 2295fb0ef1..29b55ec130 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -2422,6 +2422,7 @@ static RPCHelpMan getwalletinfo()
{
{RPCResult::Type::STR, "walletname", "the wallet name"},
{RPCResult::Type::NUM, "walletversion", "the wallet version"},
+ {RPCResult::Type::STR, "format", "the database format (bdb or sqlite)"},
{RPCResult::Type::STR_AMOUNT, "balance", "DEPRECATED. Identical to getbalances().mine.trusted"},
{RPCResult::Type::STR_AMOUNT, "unconfirmed_balance", "DEPRECATED. Identical to getbalances().mine.untrusted_pending"},
{RPCResult::Type::STR_AMOUNT, "immature_balance", "DEPRECATED. Identical to getbalances().mine.immature"},
@@ -2465,6 +2466,7 @@ static RPCHelpMan getwalletinfo()
int64_t kp_oldest = pwallet->GetOldestKeyPoolTime();
obj.pushKV("walletname", pwallet->GetName());
obj.pushKV("walletversion", pwallet->GetVersion());
+ obj.pushKV("format", pwallet->GetDatabase().Format());
obj.pushKV("balance", ValueFromAmount(bal.m_mine_trusted));
obj.pushKV("unconfirmed_balance", ValueFromAmount(bal.m_mine_untrusted_pending));
obj.pushKV("immature_balance", ValueFromAmount(bal.m_mine_immature));