filter for confirmed coins when checking recovery paths
The recovery transaction created by `createrecovery` only includes confirmed coins and so we should only consider these coins when checking for available recovery paths. An unconfirmed coin could not be broadcast in a recovery transaction as it would not yet satisfy the timelock constraint.
This commit is contained in:
parent
2485e250d6
commit
2279b332d4
@ -244,7 +244,8 @@ fn recovery_paths(wallet: &Wallet, coins: &[Coin], blockheight: i32) -> Vec<Reco
|
||||
let (number_of_coins, total_amount) = coins
|
||||
.iter()
|
||||
.filter(|coin| {
|
||||
coin.spend_info.is_none()
|
||||
coin.block_height.is_some() // only confirmed coins are included in a recovery transaction
|
||||
&& coin.spend_info.is_none()
|
||||
&& remaining_sequence(coin, blockheight as u32, sequence) <= 1
|
||||
})
|
||||
.fold(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user