HomePhabricator

[BroadcastTransaction] Remove unsafe move operator

Description

[BroadcastTransaction] Remove unsafe move operator

Summary:
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 is a backport of core#19879
https://github.com/bitcoin/bitcoin/pull/19879/commits/a8a64acaf32ac21feeb885671772282b531ef9a2

The other commits of that pull request are not relevant, as they deal with segwit issues.
This missing backport was noticed in the review of D10464, which adds a use of tx after move.

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D10474

Details

Provenance
Amiti Uttarwar <amiti@uttarwar.org>Authored on Aug 25 2020, 17:49
PiRKCommitted on Nov 16 2021, 15:55
PiRKPushed on Nov 16 2021, 15:55
Reviewer
Restricted Project
Differential Revision
D10474: [BroadcastTransaction] Remove unsafe move operator
Parents
rABC07faf1c86498: Bump version to v0.24.7
Branches
Unknown
Tags
Unknown