wallet: Set preset input sequence through coin control

This commit is contained in:
Andrew Chow
2022-05-31 23:51:49 -04:00
committed by Andrew Chow
parent 596642c5a9
commit 4d335bb1e0
3 changed files with 37 additions and 3 deletions

View File

@@ -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