diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2014-09-10 01:38:43 +0200 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2014-09-10 01:44:30 +0200 |
commit | f7cdcb80ab7016e33e8399df796885ce54eb63b0 (patch) | |
tree | 0d8dc00b07b55b3be99fb475d04827f5e37506c6 /src/rpcrawtransaction.cpp | |
parent | 4ebd80298d53ab24a5f2624b6f86bfd43be5fa6e (diff) | |
parent | 629d75faac84bc0a00533d01dd291a4e6394a51f (diff) |
Merge pull request #4822
629d75f Combine CCoinsViewCache's HaveCoins and const GetCoins into AccessCoins. (Pieter Wuille)
Diffstat (limited to 'src/rpcrawtransaction.cpp')
-rw-r--r-- | src/rpcrawtransaction.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index b5551524be..c5c99870fc 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -568,7 +568,7 @@ Value signrawtransaction(const Array& params, bool fHelp) BOOST_FOREACH(const CTxIn& txin, mergedTx.vin) { const uint256& prevHash = txin.prevout.hash; CCoins coins; - view.GetCoins(prevHash, coins); // this is certainly allowed to fail + view.AccessCoins(prevHash); // this is certainly allowed to fail } view.SetBackend(viewDummy); // switch back to avoid locking mempool for too long @@ -672,12 +672,12 @@ Value signrawtransaction(const Array& params, bool fHelp) // Sign what we can: for (unsigned int i = 0; i < mergedTx.vin.size(); i++) { CTxIn& txin = mergedTx.vin[i]; - CCoins coins; - if (!view.GetCoins(txin.prevout.hash, coins) || !coins.IsAvailable(txin.prevout.n)) { + const CCoins* coins = view.AccessCoins(txin.prevout.hash); + if (coins == NULL || !coins->IsAvailable(txin.prevout.n)) { fComplete = false; continue; } - const CScript& prevPubKey = coins.vout[txin.prevout.n].scriptPubKey; + const CScript& prevPubKey = coins->vout[txin.prevout.n].scriptPubKey; txin.scriptSig.clear(); // Only sign SIGHASH_SINGLE if there's a corresponding output: @@ -735,9 +735,9 @@ Value sendrawtransaction(const Array& params, bool fHelp) fOverrideFees = params[1].get_bool(); CCoinsViewCache &view = *pcoinsTip; - CCoins existingCoins; + const CCoins* existingCoins = view.AccessCoins(hashTx); bool fHaveMempool = mempool.exists(hashTx); - bool fHaveChain = view.GetCoins(hashTx, existingCoins) && existingCoins.nHeight < 1000000000; + bool fHaveChain = existingCoins && existingCoins->nHeight < 1000000000; if (!fHaveMempool && !fHaveChain) { // push to local node and sync with wallets CValidationState state; |