From a00eb388e8046fe105666445dff6c91e8f8664cb Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Fri, 18 Oct 2019 14:44:58 -0400 Subject: [PATCH 1/5] Allow CInputCoin to also be constructed with COutPoint and CTxOut --- src/wallet/coinselection.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/wallet/coinselection.h b/src/wallet/coinselection.h index a28bee622e3..78d877a10ba 100644 --- a/src/wallet/coinselection.h +++ b/src/wallet/coinselection.h @@ -37,6 +37,18 @@ public: m_input_bytes = input_bytes; } + CInputCoin(const COutPoint& outpoint_in, const CTxOut& txout_in) + { + outpoint = outpoint_in; + txout = txout_in; + effective_value = txout.nValue; + } + + CInputCoin(const COutPoint& outpoint_in, const CTxOut& txout_in, int input_bytes) : CInputCoin(outpoint_in, txout_in) + { + m_input_bytes = input_bytes; + } + COutPoint outpoint; CTxOut txout; CAmount effective_value; From d5cfb864ae16da62399bc97ab1ed54d32cf0cce9 Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Fri, 18 Oct 2019 17:17:17 -0400 Subject: [PATCH 2/5] Allow Coin Selection be able to take external inputs --- src/wallet/coincontrol.h | 29 ++++++++++++++ src/wallet/spend.cpp | 85 +++++++++++++++++++++++++--------------- src/wallet/spend.h | 5 ++- src/wallet/wallet.cpp | 23 +++++------ src/wallet/wallet.h | 9 +++-- 5 files changed, 103 insertions(+), 48 deletions(-) diff --git a/src/wallet/coincontrol.h b/src/wallet/coincontrol.h index 85cbec76b74..c989512d3ef 100644 --- a/src/wallet/coincontrol.h +++ b/src/wallet/coincontrol.h @@ -9,9 +9,14 @@ #include #include #include +#include