HomePhabricator

Remove CWalletTx merging logic from AddToWallet

Description

Remove CWalletTx merging logic from AddToWallet

Summary:

Instead of AddToWallet taking a temporary CWalletTx object and then potentially
merging it with a pre-existing CWalletTx, have it take a callback so callers
can update the pre-existing CWalletTx directly.

This makes AddToWallet simpler because now it is only has to be concerned with
saving CWalletTx objects and not merging them.

This makes AddToWallet calls clearer because they can now make direct updates to
CWalletTx entries without having to make temporary objects and then worry about
how they will be merged.

This is a pure refactoring, no behavior is changing.

This is a backport of Core PR9381 [1/5]
https://github.com/bitcoin/bitcoin/pull/9381/commits/2b9cba206594bfbcefcef0c88a0bf793819643bd

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

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

Details

Provenance
Russell Yanofsky <russ@yanofsky.org>Authored on Dec 19 2016, 16:25
PiRKCommitted on Jan 27 2021, 15:53
PiRKPushed on Jan 27 2021, 15:53
Reviewer
Restricted Project
Differential Revision
D9074: Remove CWalletTx merging logic from AddToWallet
Parents
rABC521692129ee2: init: Remove boost from ThreadImport
Branches
Unknown
Tags
Unknown