mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-12 04:42:36 -03:00
[BroadcastTransaction] Remove unsafe move operator
Previously, `tx` was being read after having `std::move` called on it. The std::move operator indicates to the compiler that this object may be "moved from", so we shouldn't subsequently read from it. The current code is not problematic since tx is passed in as a const ref. But this `std::move` is at best misleading & at worst problematic, so remove it.
This commit is contained in:
parent
125c038126
commit
a8a64acaf3
1 changed files with 2 additions and 2 deletions
|
@ -38,8 +38,8 @@ TransactionError BroadcastTransaction(NodeContext& node, const CTransactionRef t
|
||||||
if (!node.mempool->exists(hashTx)) {
|
if (!node.mempool->exists(hashTx)) {
|
||||||
// Transaction is not already in the mempool. Submit it.
|
// Transaction is not already in the mempool. Submit it.
|
||||||
TxValidationState state;
|
TxValidationState state;
|
||||||
if (!AcceptToMemoryPool(*node.mempool, state, std::move(tx),
|
if (!AcceptToMemoryPool(*node.mempool, state, tx,
|
||||||
nullptr /* plTxnReplaced */, false /* bypass_limits */, max_tx_fee)) {
|
nullptr /* plTxnReplaced */, false /* bypass_limits */, max_tx_fee)) {
|
||||||
err_string = state.ToString();
|
err_string = state.ToString();
|
||||||
if (state.IsInvalid()) {
|
if (state.IsInvalid()) {
|
||||||
if (state.GetResult() == TxValidationResult::TX_MISSING_INPUTS) {
|
if (state.GetResult() == TxValidationResult::TX_MISSING_INPUTS) {
|
||||||
|
|
Loading…
Reference in a new issue