diff options
author | Antoine Riard <ariard@student.42.fr> | 2019-04-10 13:38:41 +0000 |
---|---|---|
committer | Antoine Riard <ariard@student.42.fr> | 2019-04-17 08:17:17 -0400 |
commit | 99e88a3726c2325e3a3a35c0a750bde25bd58ad0 (patch) | |
tree | 050a20cb4577f577def4c79210b886eef72e659f /src/wallet/rpcwallet.cpp | |
parent | c536dfbcb00fb15963bf5d507b7017c241718bf6 (diff) | |
download | bitcoin-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.cpp | 9 |
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) |