aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/rpcwallet.cpp
diff options
context:
space:
mode:
authorAntoine Riard <ariard@student.42.fr>2019-04-10 13:38:41 +0000
committerAntoine Riard <ariard@student.42.fr>2019-04-17 08:17:17 -0400
commit99e88a3726c2325e3a3a35c0a750bde25bd58ad0 (patch)
tree050a20cb4577f577def4c79210b886eef72e659f /src/wallet/rpcwallet.cpp
parentc536dfbcb00fb15963bf5d507b7017c241718bf6 (diff)
downloadbitcoin-99e88a3726c2325e3a3a35c0a750bde25bd58ad0.tar.xz
rpc: Remove dependency on interfaces::Chain in SignTransaction
Comment SignTransaction utility
Diffstat (limited to 'src/wallet/rpcwallet.cpp')
-rw-r--r--src/wallet/rpcwallet.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
index cb6f7637ad..0397978061 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -3150,7 +3150,14 @@ UniValue signrawtransactionwithwallet(const JSONRPCRequest& request)
LOCK(pwallet->cs_wallet);
EnsureWalletIsUnlocked(pwallet);
- return SignTransaction(pwallet->chain(), mtx, request.params[1], pwallet, false, request.params[2]);
+ // Fetch previous transactions (inputs):
+ std::map<COutPoint, Coin> coins;
+ for (const CTxIn& txin : mtx.vin) {
+ coins[txin.prevout]; // Create empty map entry keyed by prevout.
+ }
+ pwallet->chain().findCoins(coins);
+
+ return SignTransaction(mtx, request.params[1], pwallet, coins, false, request.params[2]);
}
static UniValue bumpfee(const JSONRPCRequest& request)