mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Code simplifications after CTransaction::GetHash() caching
This commit is contained in:
parent
4949004d68
commit
d38da59bf6
12 changed files with 67 additions and 78 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue