mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
Code simplifications after CTransaction::GetHash() caching
This commit is contained in:
@@ -770,7 +770,7 @@ Value sendrawtransaction(const Array& params, bool fHelp)
|
||||
catch (std::exception &e) {
|
||||
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
|
||||
}
|
||||
uint256 hashTx = tx.GetHash();
|
||||
const uint256 &hashTx = tx.GetHash();
|
||||
|
||||
CCoinsViewCache &view = *pcoinsTip;
|
||||
CCoins existingCoins;
|
||||
@@ -780,7 +780,7 @@ Value sendrawtransaction(const Array& params, bool fHelp)
|
||||
// push to local node and sync with wallets
|
||||
CValidationState state;
|
||||
if (AcceptToMemoryPool(mempool, state, tx, false, NULL, !fOverrideFees))
|
||||
SyncWithWallets(hashTx, tx, NULL);
|
||||
SyncWithWallets(tx, NULL);
|
||||
else {
|
||||
if(state.IsInvalid())
|
||||
throw JSONRPCError(RPC_TRANSACTION_REJECTED, strprintf("%i: %s", state.GetRejectCode(), state.GetRejectReason()));
|
||||
@@ -790,7 +790,7 @@ Value sendrawtransaction(const Array& params, bool fHelp)
|
||||
} else if (fHaveChain) {
|
||||
throw JSONRPCError(RPC_TRANSACTION_ALREADY_IN_CHAIN, "transaction already in block chain");
|
||||
}
|
||||
RelayTransaction(tx, hashTx);
|
||||
RelayTransaction(tx);
|
||||
|
||||
return hashTx.GetHex();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user