diff options
author | Murch <murch@murch.one> | 2024-01-08 15:35:05 -0500 |
---|---|---|
committer | Murch <murch@murch.one> | 2024-02-09 10:50:10 +0100 |
commit | 1502231229dbc32c94e80a2fc2959275c5d246ef (patch) | |
tree | 2867b67a28771ee9ae862146d549e4652bbd0833 /src/wallet/coinselection.h | |
parent | 7488acc64685ae16e20b78e7ad018137f27fe404 (diff) | |
download | bitcoin-1502231229dbc32c94e80a2fc2959275c5d246ef.tar.xz |
coinselection: Track whether CG completed
CoinGrinder may not be able to exhaustively search all potentially
interesting combinations for large UTXO pools, so we keep track of
whether the search was terminated by the iteration limit.
Diffstat (limited to 'src/wallet/coinselection.h')
-rw-r--r-- | src/wallet/coinselection.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/wallet/coinselection.h b/src/wallet/coinselection.h index ba9e6bafd9..80c92e1b0e 100644 --- a/src/wallet/coinselection.h +++ b/src/wallet/coinselection.h @@ -330,6 +330,8 @@ private: bool m_use_effective{false}; /** The computed waste */ std::optional<CAmount> m_waste; + /** False if algorithm was cut short by hitting limit of attempts and solution is non-optimal */ + bool m_algo_completed{true}; /** The count of selections that were evaluated by this coin selection attempt */ size_t m_selections_evaluated; /** Total weight of the selected inputs */ @@ -389,6 +391,12 @@ public: void ComputeAndSetWaste(const CAmount min_viable_change, const CAmount change_cost, const CAmount change_fee); [[nodiscard]] CAmount GetWaste() const; + /** Tracks that algorithm was able to exhaustively search the entire combination space before hitting limit of tries */ + void SetAlgoCompleted(bool algo_completed); + + /** Get m_algo_completed */ + bool GetAlgoCompleted() const; + /** Record the number of selections that were evaluated */ void SetSelectionsEvaluated(size_t attempts); |