aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/rpcwallet.cpp
diff options
context:
space:
mode:
authorMeshCollider <dobsonsa68@gmail.com>2019-04-27 15:29:30 +1200
committerMeshCollider <dobsonsa68@gmail.com>2019-04-27 15:29:48 +1200
commit703414994aa46c8f7d37ff66c77573ae6e7dcb20 (patch)
treefdead92a2f32fe47be2506c54b15191e570b6060 /src/wallet/rpcwallet.cpp
parent65ec4d6fb2be79034d814531daab30541c6e5985 (diff)
parent99e88a3726c2325e3a3a35c0a750bde25bd58ad0 (diff)
Merge #15784: rpc: Remove dependency on interfaces::Chain in SignTransaction
99e88a372 rpc: Remove dependency on interfaces::Chain in SignTransaction (Antoine Riard) Pull request description: Assuming wallet RPCs and node RPCs will go into different processes, signrawtransactionwithkey doesn't need to access Coins via interfaces::Chain, it may use directly utility in node/coins.cpp Obviously will need rebase after #15638 Tree-SHA512: 42ee8fcbcd38643bbd82210db6f68249bed5ee036a4c930a1db534d0469a133e287b8869c977bf0cc79a7296dde04f72adb74d24e1cd20f4a280f4c2b7fceb74
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 7de74bac4d..5a22508c4b 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)