Skip to content
Permalink
Browse files

Merge rpc_gai_txids-0.18

  • Loading branch information...
luke-jr committed Aug 23, 2019
2 parents aca8309 + 224a757 commit 4ea59f5b234d71943f666bd777bb764a83ef1735
Showing with 13 additions and 0 deletions.
  1. +13 −0 src/wallet/rpcwallet.cpp
@@ -4007,6 +4007,10 @@ UniValue getaddressinfo(const JSONRPCRequest& request)
" \"name\": \"labelname\" (string) The label\n"
" \"purpose\": \"string\" (string) Purpose of address (\"send\" for sending address, \"receive\" for receiving address)\n"
" },...\n"
" ],\n"
" \"use_txids\": [\n"
" \"txid\", (string) The ids of transactions involving this wallet which received with the address\n"
" ...\n"
" ]\n"
"}\n"
},
@@ -4080,6 +4084,15 @@ UniValue getaddressinfo(const JSONRPCRequest& request)
}
ret.pushKV("labels", std::move(labels));

// NOTE: Intentionally not special-casing a single txid: while addresses
// should never be reused, it's not unexpected to have RBF result in
// multiple txids for a single use.
UniValue use_txids(UniValue::VARR);
pwallet->FindScriptPubKeyUsed(std::set<CScript>{scriptPubKey}, [&use_txids](const CWalletTx& wtx){
use_txids.push_back(wtx.tx->GetHash().GetHex());
});
ret.pushKV("use_txids", std::move(use_txids));

return ret;
}

0 comments on commit 4ea59f5

Please sign in to comment.
You can’t perform that action at this time.