Skip to content

Commit

Permalink
commands: add ancestor info to unconfirmed coins
Browse files Browse the repository at this point in the history
  • Loading branch information
jp1ac4 committed Jan 8, 2024
1 parent 38b8df2 commit 5225ca8
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -506,11 +506,23 @@ impl DaemonControl {
}
}
coins
.into_values()
.map(|c| {
.into_iter()
.map(|(op, c)| {
let ancestor_info = if c.block_info.is_none() {
// We include any non-change coins here as they have been selected by the caller.
// If the unconfirmed coin's transaction is no longer in the mempool, keep the
// coin as a candidate but without any ancestor info (same as confirmed candidate).
self.bitcoin
.mempool_entry(&op.txid)
.map(AncestorInfo::from_mempool_entry)
} else {
None
};
coin_to_candidate(
&c, /*must_select=*/ true, /*sequence=*/ None,
/*ancestor_info=*/ None,
&c,
/*must_select=*/ true,
/*sequence=*/ None,
ancestor_info,
)
})
.collect()
Expand Down

0 comments on commit 5225ca8

Please sign in to comment.