diff options
author | Andrew Chow <achow101-github@achow101.com> | 2022-05-31 23:51:49 -0400 |
---|---|---|
committer | Andrew Chow <github@achow101.com> | 2023-12-08 14:55:14 -0500 |
commit | 4d335bb1e00a414a4740007d5a192a73179b2262 (patch) | |
tree | 00e59a98e4bd7a010b6651b33cc035047b6dd2e1 /src/wallet/coincontrol.cpp | |
parent | 596642c5a9f52dda2599b0bde424366bb22b3c6e (diff) | |
download | bitcoin-4d335bb1e00a414a4740007d5a192a73179b2262.tar.xz |
wallet: Set preset input sequence through coin control
Diffstat (limited to 'src/wallet/coincontrol.cpp')
-rw-r--r-- | src/wallet/coincontrol.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/wallet/coincontrol.cpp b/src/wallet/coincontrol.cpp index 00852b5f85..f13b7073be 100644 --- a/src/wallet/coincontrol.cpp +++ b/src/wallet/coincontrol.cpp @@ -72,6 +72,12 @@ std::optional<int64_t> CCoinControl::GetInputWeight(const COutPoint& outpoint) c return it != m_selected.end() ? it->second.GetInputWeight() : std::nullopt; } +std::optional<uint32_t> CCoinControl::GetSequence(const COutPoint& outpoint) const +{ + const auto it = m_selected.find(outpoint); + return it != m_selected.end() ? it->second.GetSequence() : std::nullopt; +} + void PreselectedInput::SetTxOut(const CTxOut& txout) { m_txout = txout; @@ -97,4 +103,14 @@ std::optional<int64_t> PreselectedInput::GetInputWeight() const { return m_weight; } + +void PreselectedInput::SetSequence(uint32_t sequence) +{ + m_sequence = sequence; +} + +std::optional<uint32_t> PreselectedInput::GetSequence() const +{ + return m_sequence; +} } // namespace wallet |