ClaimableOnChannelClose {
/// The amount available to claim, in satoshis, excluding the on-chain fees which will be
/// required to do so.
- claimable_amount_satoshis: u64,
+ amount_satoshis: u64,
},
/// The channel has been closed, and the given balance is ours but awaiting confirmations until
/// we consider it spendable.
ClaimableAwaitingConfirmations {
/// The amount available to claim, in satoshis, possibly excluding the on-chain fees which
/// were spent in broadcasting the transaction.
- claimable_amount_satoshis: u64,
+ amount_satoshis: u64,
/// The height at which an [`Event::SpendableOutputs`] event will be generated for this
/// amount.
confirmation_height: u32,
ContentiousClaimable {
/// The amount available to claim, in satoshis, excluding the on-chain fees which will be
/// required to do so.
- claimable_amount_satoshis: u64,
+ amount_satoshis: u64,
/// The height at which the counterparty may be able to claim the balance if we have not
/// done so.
timeout_height: u32,
MaybeTimeoutClaimableHTLC {
/// The amount potentially available to claim, in satoshis, excluding the on-chain fees
/// which will be required to do so.
- claimable_amount_satoshis: u64,
+ amount_satoshis: u64,
/// The height at which we will be able to claim the balance if our counterparty has not
/// done so.
claimable_height: u32,
MaybePreimageClaimableHTLC {
/// The amount potentially available to claim, in satoshis, excluding the on-chain fees
/// which will be required to do so.
- claimable_amount_satoshis: u64,
+ amount_satoshis: u64,
/// The height at which our counterparty will be able to claim the balance if we have not
/// yet received the preimage and claimed it ourselves.
expiry_height: u32,
///
/// Note that for outputs from HTLC balances this may be excluding some on-chain fees that
/// were already spent.
- claimable_amount_satoshis: u64,
+ amount_satoshis: u64,
},
}
/// On-chain fees required to claim the balance are not included in this amount.
pub fn claimable_amount_satoshis(&self) -> u64 {
match self {
- Balance::ClaimableOnChannelClose {
- claimable_amount_satoshis,
- } => *claimable_amount_satoshis,
- Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis,
- ..
- } => *claimable_amount_satoshis,
- Balance::ContentiousClaimable {
- claimable_amount_satoshis,
- ..
- } => *claimable_amount_satoshis,
- Balance::MaybeTimeoutClaimableHTLC {
- ..
- } => 0,
- Balance::MaybePreimageClaimableHTLC {
- ..
- } => 0,
- Balance::CounterpartyRevokedOutputClaimable {
- claimable_amount_satoshis,
- ..
- } => *claimable_amount_satoshis,
+ Balance::ClaimableOnChannelClose { amount_satoshis, .. }|
+ Balance::ClaimableAwaitingConfirmations { amount_satoshis, .. }|
+ Balance::ContentiousClaimable { amount_satoshis, .. }|
+ Balance::CounterpartyRevokedOutputClaimable { amount_satoshis, .. }
+ => *amount_satoshis,
+ Balance::MaybeTimeoutClaimableHTLC { .. }|
+ Balance::MaybePreimageClaimableHTLC { .. }
+ => 0,
}
}
}
if let Some(conf_thresh) = holder_delayed_output_pending {
debug_assert!(holder_commitment);
return Some(Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: htlc.amount_msat / 1000,
+ amount_satoshis: htlc.amount_msat / 1000,
confirmation_height: conf_thresh,
});
} else if htlc_resolved.is_some() && !htlc_output_spend_pending {
debug_assert!(!htlc.offered || htlc_spend_pending.is_none() || !htlc_spend_pending.unwrap().1,
"We don't (currently) generate preimage claims against revoked outputs, where did you get one?!");
return Some(Balance::CounterpartyRevokedOutputClaimable {
- claimable_amount_satoshis: htlc.amount_msat / 1000,
+ amount_satoshis: htlc.amount_msat / 1000,
});
}
} else if htlc.offered == holder_commitment {
// and awaiting confirmations on it.
if let Some(conf_thresh) = holder_timeout_spend_pending {
return Some(Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: htlc.amount_msat / 1000,
+ amount_satoshis: htlc.amount_msat / 1000,
confirmation_height: conf_thresh,
});
} else {
return Some(Balance::MaybeTimeoutClaimableHTLC {
- claimable_amount_satoshis: htlc.amount_msat / 1000,
+ amount_satoshis: htlc.amount_msat / 1000,
claimable_height: htlc.cltv_expiry,
payment_hash: htlc.payment_hash,
});
debug_assert!(holder_timeout_spend_pending.is_none());
if let Some((conf_thresh, true)) = htlc_spend_pending {
return Some(Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: htlc.amount_msat / 1000,
+ amount_satoshis: htlc.amount_msat / 1000,
confirmation_height: conf_thresh,
});
} else {
return Some(Balance::ContentiousClaimable {
- claimable_amount_satoshis: htlc.amount_msat / 1000,
+ amount_satoshis: htlc.amount_msat / 1000,
timeout_height: htlc.cltv_expiry,
payment_hash: htlc.payment_hash,
payment_preimage: *payment_preimage,
}
} else if htlc_resolved.is_none() {
return Some(Balance::MaybePreimageClaimableHTLC {
- claimable_amount_satoshis: htlc.amount_msat / 1000,
+ amount_satoshis: htlc.amount_msat / 1000,
expiry_height: htlc.cltv_expiry,
payment_hash: htlc.payment_hash,
});
} else { None }
}) {
res.push(Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: value,
+ amount_satoshis: value,
confirmation_height: conf_thresh,
});
} else {
descriptor: SpendableOutputDescriptor::StaticOutput { output, .. }
} = &event.event {
res.push(Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: output.value,
+ amount_satoshis: output.value,
confirmation_height: event.confirmation_threshold(),
});
if let Some(confirmed_to_self_idx) = confirmed_counterparty_output.map(|(idx, _)| idx) {
.is_output_spend_pending(&BitcoinOutPoint::new(txid, confirmed_to_self_idx));
if output_spendable {
res.push(Balance::CounterpartyRevokedOutputClaimable {
- claimable_amount_satoshis: amt,
+ amount_satoshis: amt,
});
}
} else {
walk_htlcs!(true, false, us.current_holder_commitment_tx.htlc_outputs.iter().map(|(a, _, _)| a));
if let Some(conf_thresh) = pending_commitment_tx_conf_thresh {
res.push(Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: us.current_holder_commitment_tx.to_self_value_sat,
+ amount_satoshis: us.current_holder_commitment_tx.to_self_value_sat,
confirmation_height: conf_thresh,
});
}
walk_htlcs!(true, false, prev_commitment.htlc_outputs.iter().map(|(a, _, _)| a));
if let Some(conf_thresh) = pending_commitment_tx_conf_thresh {
res.push(Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: prev_commitment.to_self_value_sat,
+ amount_satoshis: prev_commitment.to_self_value_sat,
confirmation_height: conf_thresh,
});
}
// neither us nor our counterparty misbehaved. At worst we've under-estimated
// the amount we can claim as we'll punish a misbehaving counterparty.
res.push(Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: us.current_holder_commitment_tx.to_self_value_sat,
+ amount_satoshis: us.current_holder_commitment_tx.to_self_value_sat,
confirmation_height: conf_thresh,
});
}
if htlc.transaction_output_index.is_none() { continue; }
if htlc.offered {
res.push(Balance::MaybeTimeoutClaimableHTLC {
- claimable_amount_satoshis: htlc.amount_msat / 1000,
+ amount_satoshis: htlc.amount_msat / 1000,
claimable_height: htlc.cltv_expiry,
payment_hash: htlc.payment_hash,
});
// As long as the HTLC is still in our latest commitment state, treat
// it as potentially claimable, even if it has long-since expired.
res.push(Balance::MaybePreimageClaimableHTLC {
- claimable_amount_satoshis: htlc.amount_msat / 1000,
+ amount_satoshis: htlc.amount_msat / 1000,
expiry_height: htlc.cltv_expiry,
payment_hash: htlc.payment_hash,
});
}
}
res.push(Balance::ClaimableOnChannelClose {
- claimable_amount_satoshis: us.current_holder_commitment_tx.to_self_value_sat + claimable_inbound_htlc_value_sat,
+ amount_satoshis: us.current_holder_commitment_tx.to_self_value_sat + claimable_inbound_htlc_value_sat,
});
}
let channel_type_features = get_channel_type_features!(nodes[0], nodes[1], chan_id);
assert_eq!(vec![Balance::ClaimableOnChannelClose {
- claimable_amount_satoshis: 1_000_000 - 1_000 - chan_feerate * channel::commitment_tx_base_weight(&channel_type_features) / 1000
+ amount_satoshis: 1_000_000 - 1_000 - chan_feerate * channel::commitment_tx_base_weight(&channel_type_features) / 1000
}],
nodes[0].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances());
- assert_eq!(vec![Balance::ClaimableOnChannelClose { claimable_amount_satoshis: 1_000, }],
+ assert_eq!(vec![Balance::ClaimableOnChannelClose { amount_satoshis: 1_000, }],
nodes[1].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances());
nodes[0].node.close_channel(&chan_id, &nodes[1].node.get_our_node_id()).unwrap();
assert!(nodes[1].chain_monitor.chain_monitor.get_and_clear_pending_events().is_empty());
assert_eq!(vec![Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 1_000_000 - 1_000 - chan_feerate * channel::commitment_tx_base_weight(&channel_type_features) / 1000,
+ amount_satoshis: 1_000_000 - 1_000 - chan_feerate * channel::commitment_tx_base_weight(&channel_type_features) / 1000,
confirmation_height: nodes[0].best_block_info().1 + ANTI_REORG_DELAY - 1,
}],
nodes[0].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances());
assert_eq!(vec![Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 1000,
+ amount_satoshis: 1000,
confirmation_height: nodes[1].best_block_info().1 + ANTI_REORG_DELAY - 1,
}],
nodes[1].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances());
let remote_txn = get_local_commitment_txn!(nodes[1], chan_id);
let sent_htlc_balance = Balance::MaybeTimeoutClaimableHTLC {
- claimable_amount_satoshis: 3_000,
+ amount_satoshis: 3_000,
claimable_height: htlc_cltv_timeout,
payment_hash,
};
let sent_htlc_timeout_balance = Balance::MaybeTimeoutClaimableHTLC {
- claimable_amount_satoshis: 4_000,
+ amount_satoshis: 4_000,
claimable_height: htlc_cltv_timeout,
payment_hash: timeout_payment_hash,
};
let received_htlc_balance = Balance::MaybePreimageClaimableHTLC {
- claimable_amount_satoshis: 3_000,
+ amount_satoshis: 3_000,
expiry_height: htlc_cltv_timeout,
payment_hash,
};
let received_htlc_timeout_balance = Balance::MaybePreimageClaimableHTLC {
- claimable_amount_satoshis: 4_000,
+ amount_satoshis: 4_000,
expiry_height: htlc_cltv_timeout,
payment_hash: timeout_payment_hash,
};
let received_htlc_claiming_balance = Balance::ContentiousClaimable {
- claimable_amount_satoshis: 3_000,
+ amount_satoshis: 3_000,
timeout_height: htlc_cltv_timeout,
payment_hash,
payment_preimage,
};
let received_htlc_timeout_claiming_balance = Balance::ContentiousClaimable {
- claimable_amount_satoshis: 4_000,
+ amount_satoshis: 4_000,
timeout_height: htlc_cltv_timeout,
payment_hash: timeout_payment_hash,
payment_preimage: timeout_payment_preimage,
// Before B receives the payment preimage, it only suggests the push_msat value of 1_000 sats
// as claimable. A lists both its to-self balance and the (possibly-claimable) HTLCs.
assert_eq!(sorted_vec(vec![Balance::ClaimableOnChannelClose {
- claimable_amount_satoshis: 1_000_000 - 3_000 - 4_000 - 1_000 - 3 - chan_feerate *
+ amount_satoshis: 1_000_000 - 3_000 - 4_000 - 1_000 - 3 - chan_feerate *
(channel::commitment_tx_base_weight(&channel_type_features) + 2 * channel::COMMITMENT_TX_WEIGHT_PER_HTLC) / 1000,
}, sent_htlc_balance.clone(), sent_htlc_timeout_balance.clone()]),
sorted_vec(nodes[0].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
assert_eq!(sorted_vec(vec![Balance::ClaimableOnChannelClose {
- claimable_amount_satoshis: 1_000,
+ amount_satoshis: 1_000,
}, received_htlc_balance.clone(), received_htlc_timeout_balance.clone()]),
sorted_vec(nodes[1].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
// Once B has received the payment preimage, it includes the value of the HTLC in its
// "claimable if you were to close the channel" balance.
let mut a_expected_balances = vec![Balance::ClaimableOnChannelClose {
- claimable_amount_satoshis: 1_000_000 - // Channel funding value in satoshis
+ amount_satoshis: 1_000_000 - // Channel funding value in satoshis
4_000 - // The to-be-failed HTLC value in satoshis
3_000 - // The claimed HTLC value in satoshis
1_000 - // The push_msat value in satoshis
assert_eq!(sorted_vec(a_expected_balances),
sorted_vec(nodes[0].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
assert_eq!(vec![Balance::ClaimableOnChannelClose {
- claimable_amount_satoshis: 1_000 + 3_000 + 4_000,
+ amount_satoshis: 1_000 + 3_000 + 4_000,
}],
nodes[1].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances());
assert!(nodes[1].chain_monitor.chain_monitor.get_and_clear_pending_events().is_empty());
assert_eq!(sorted_vec(vec![Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 1_000_000 - 3_000 - 4_000 - 1_000 - 3 - chan_feerate *
+ amount_satoshis: 1_000_000 - 3_000 - 4_000 - 1_000 - 3 - chan_feerate *
(channel::commitment_tx_base_weight(&channel_type_features) + 2 * channel::COMMITMENT_TX_WEIGHT_PER_HTLC) / 1000,
confirmation_height: nodes[0].best_block_info().1 + ANTI_REORG_DELAY - 1,
}, sent_htlc_balance.clone(), sent_htlc_timeout_balance.clone()]),
// The main non-HTLC balance is just awaiting confirmations, but the claimable height is the
// CSV delay, not ANTI_REORG_DELAY.
assert_eq!(sorted_vec(vec![Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 1_000,
+ amount_satoshis: 1_000,
confirmation_height: node_b_commitment_claimable,
},
// Both HTLC balances are "contentious" as our counterparty could claim them if we wait too
assert_eq!(sorted_vec(vec![sent_htlc_balance.clone(), sent_htlc_timeout_balance.clone()]),
sorted_vec(nodes[0].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
assert_eq!(sorted_vec(vec![Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 1_000,
+ amount_satoshis: 1_000,
confirmation_height: node_b_commitment_claimable,
}, received_htlc_claiming_balance.clone(), received_htlc_timeout_claiming_balance.clone()]),
sorted_vec(nodes[1].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
mine_transaction(&nodes[0], &a_broadcast_txn[1]);
assert!(nodes[0].node.get_and_clear_pending_events().is_empty());
assert_eq!(vec![Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 4_000,
+ amount_satoshis: 4_000,
confirmation_height: nodes[0].best_block_info().1 + ANTI_REORG_DELAY - 1,
}],
nodes[0].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances());
mine_transaction(&nodes[1], &b_broadcast_txn[0]);
assert_eq!(sorted_vec(vec![Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 1_000,
+ amount_satoshis: 1_000,
confirmation_height: node_b_commitment_claimable,
}, Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 3_000,
+ amount_satoshis: 3_000,
confirmation_height: node_b_htlc_claimable,
}, received_htlc_timeout_claiming_balance.clone()]),
sorted_vec(nodes[1].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
test_spendable_output(&nodes[1], &remote_txn[0]);
assert_eq!(sorted_vec(vec![Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 3_000,
+ amount_satoshis: 3_000,
confirmation_height: node_b_htlc_claimable,
}, received_htlc_timeout_claiming_balance.clone()]),
sorted_vec(nodes[1].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
check_closed_event!(nodes[0], 1, ClosureReason::CommitmentTxConfirmed);
let htlc_balance_known_preimage = Balance::MaybeTimeoutClaimableHTLC {
- claimable_amount_satoshis: 10_000,
+ amount_satoshis: 10_000,
claimable_height: htlc_cltv_timeout,
payment_hash,
};
let htlc_balance_unknown_preimage = Balance::MaybeTimeoutClaimableHTLC {
- claimable_amount_satoshis: 20_000,
+ amount_satoshis: 20_000,
claimable_height: htlc_cltv_timeout,
payment_hash: payment_hash_2,
};
assert_eq!(sorted_vec(vec![Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 1_000_000 - 10_000 - 20_000 - chan_feerate *
+ amount_satoshis: 1_000_000 - 10_000 - 20_000 - chan_feerate *
(channel::commitment_tx_base_weight(&channel_type_features) + 2 * channel::COMMITMENT_TX_WEIGHT_PER_HTLC) / 1000,
confirmation_height: node_a_commitment_claimable,
}, htlc_balance_known_preimage.clone(), htlc_balance_unknown_preimage.clone()]),
// transaction.
connect_blocks(&nodes[0], TEST_FINAL_CLTV - 1);
assert_eq!(sorted_vec(vec![Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 1_000_000 - 10_000 - 20_000 - chan_feerate *
+ amount_satoshis: 1_000_000 - 10_000 - 20_000 - chan_feerate *
(channel::commitment_tx_base_weight(&channel_type_features) + 2 * channel::COMMITMENT_TX_WEIGHT_PER_HTLC) / 1000,
confirmation_height: node_a_commitment_claimable,
}, htlc_balance_known_preimage.clone(), htlc_balance_unknown_preimage.clone()]),
// balance) check failed. With this check removed, the code panicked in the `connect_blocks`
// call, as described, two hunks down.
assert_eq!(sorted_vec(vec![Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 1_000_000 - 10_000 - 20_000 - chan_feerate *
+ amount_satoshis: 1_000_000 - 10_000 - 20_000 - chan_feerate *
(channel::commitment_tx_base_weight(&channel_type_features) + 2 * channel::COMMITMENT_TX_WEIGHT_PER_HTLC) / 1000,
confirmation_height: node_a_commitment_claimable,
}, Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 10_000,
+ amount_satoshis: 10_000,
confirmation_height: node_a_htlc_claimable,
}, htlc_balance_unknown_preimage.clone()]),
sorted_vec(nodes[0].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
mine_transaction(&nodes[0], &bs_htlc_claim_txn[0]);
expect_payment_sent!(nodes[0], payment_preimage_2);
assert_eq!(sorted_vec(vec![Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 1_000_000 - 10_000 - 20_000 - chan_feerate *
+ amount_satoshis: 1_000_000 - 10_000 - 20_000 - chan_feerate *
(channel::commitment_tx_base_weight(&channel_type_features) + 2 * channel::COMMITMENT_TX_WEIGHT_PER_HTLC) / 1000,
confirmation_height: node_a_commitment_claimable,
}, Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 10_000,
+ amount_satoshis: 10_000,
confirmation_height: node_a_htlc_claimable,
}, htlc_balance_unknown_preimage.clone()]),
sorted_vec(nodes[0].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
expect_payment_failed!(nodes[0], payment_hash, false);
assert_eq!(sorted_vec(vec![Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 1_000_000 - 10_000 - 20_000 - chan_feerate *
+ amount_satoshis: 1_000_000 - 10_000 - 20_000 - chan_feerate *
(channel::commitment_tx_base_weight(&channel_type_features) + 2 * channel::COMMITMENT_TX_WEIGHT_PER_HTLC) / 1000,
confirmation_height: node_a_commitment_claimable,
}, Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 10_000,
+ amount_satoshis: 10_000,
confirmation_height: node_a_htlc_claimable,
}]),
sorted_vec(nodes[0].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
// `SpendableOutputs` event and removing the claimable balance entry.
connect_blocks(&nodes[0], node_a_commitment_claimable - nodes[0].best_block_info().1);
assert_eq!(vec![Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 10_000,
+ amount_satoshis: 10_000,
confirmation_height: node_a_htlc_claimable,
}],
nodes[0].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances());
let channel_type_features = get_channel_type_features!(nodes[0], nodes[1], chan_id);
let a_sent_htlc_balance = Balance::MaybeTimeoutClaimableHTLC {
- claimable_amount_satoshis: 10_000,
+ amount_satoshis: 10_000,
claimable_height: htlc_cltv_timeout,
payment_hash: to_b_failed_payment_hash,
};
let a_received_htlc_balance = Balance::MaybePreimageClaimableHTLC {
- claimable_amount_satoshis: 20_000,
+ amount_satoshis: 20_000,
expiry_height: htlc_cltv_timeout,
payment_hash: to_a_failed_payment_hash,
};
let b_received_htlc_balance = Balance::MaybePreimageClaimableHTLC {
- claimable_amount_satoshis: 10_000,
+ amount_satoshis: 10_000,
expiry_height: htlc_cltv_timeout,
payment_hash: to_b_failed_payment_hash,
};
let b_sent_htlc_balance = Balance::MaybeTimeoutClaimableHTLC {
- claimable_amount_satoshis: 20_000,
+ amount_satoshis: 20_000,
claimable_height: htlc_cltv_timeout,
payment_hash: to_a_failed_payment_hash,
};
// HTLC output is spent.
assert_eq!(sorted_vec(vec![Balance::ClaimableOnChannelClose {
- claimable_amount_satoshis: 1_000_000 - 500_000 - 10_000 - chan_feerate *
+ amount_satoshis: 1_000_000 - 500_000 - 10_000 - chan_feerate *
(channel::commitment_tx_base_weight(&channel_type_features) + 2 * channel::COMMITMENT_TX_WEIGHT_PER_HTLC) / 1000,
}, a_received_htlc_balance.clone(), a_sent_htlc_balance.clone()]),
sorted_vec(nodes[0].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
assert_eq!(sorted_vec(vec![Balance::ClaimableOnChannelClose {
- claimable_amount_satoshis: 500_000 - 20_000,
+ amount_satoshis: 500_000 - 20_000,
}, b_received_htlc_balance.clone(), b_sent_htlc_balance.clone()]),
sorted_vec(nodes[1].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
// claimable balances remain the same except for the non-HTLC balance changing variant.
let node_a_commitment_claimable = nodes[0].best_block_info().1 + BREAKDOWN_TIMEOUT as u32;
let as_pre_spend_claims = sorted_vec(vec![Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 1_000_000 - 500_000 - 10_000 - chan_feerate *
+ amount_satoshis: 1_000_000 - 500_000 - 10_000 - chan_feerate *
(channel::commitment_tx_base_weight(&channel_type_features) + 2 * channel::COMMITMENT_TX_WEIGHT_PER_HTLC) / 1000,
confirmation_height: node_a_commitment_claimable,
}, a_received_htlc_balance.clone(), a_sent_htlc_balance.clone()]);
let node_b_commitment_claimable = nodes[1].best_block_info().1 + ANTI_REORG_DELAY - 1;
let mut bs_pre_spend_claims = sorted_vec(vec![Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 500_000 - 20_000,
+ amount_satoshis: 500_000 - 20_000,
confirmation_height: node_b_commitment_claimable,
}, b_received_htlc_balance.clone(), b_sent_htlc_balance.clone()]);
assert_eq!(bs_pre_spend_claims,
mine_transaction(&nodes[0], &as_htlc_timeout_claim[0]);
let as_timeout_claimable_height = nodes[0].best_block_info().1 + (BREAKDOWN_TIMEOUT as u32) - 1;
assert_eq!(sorted_vec(vec![Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 1_000_000 - 500_000 - 10_000 - chan_feerate *
+ amount_satoshis: 1_000_000 - 500_000 - 10_000 - chan_feerate *
(channel::commitment_tx_base_weight(&channel_type_features) + 2 * channel::COMMITMENT_TX_WEIGHT_PER_HTLC) / 1000,
confirmation_height: node_a_commitment_claimable,
}, a_received_htlc_balance.clone(), Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 10_000,
+ amount_satoshis: 10_000,
confirmation_height: as_timeout_claimable_height,
}]),
sorted_vec(nodes[0].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
mine_transaction(&nodes[0], &bs_htlc_timeout_claim[0]);
assert_eq!(sorted_vec(vec![Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 1_000_000 - 500_000 - 10_000 - chan_feerate *
+ amount_satoshis: 1_000_000 - 500_000 - 10_000 - chan_feerate *
(channel::commitment_tx_base_weight(&channel_type_features) + 2 * channel::COMMITMENT_TX_WEIGHT_PER_HTLC) / 1000,
confirmation_height: node_a_commitment_claimable,
}, a_received_htlc_balance.clone(), Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 10_000,
+ amount_satoshis: 10_000,
confirmation_height: as_timeout_claimable_height,
}]),
sorted_vec(nodes[0].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
connect_blocks(&nodes[0], 1);
assert_eq!(sorted_vec(vec![Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 1_000_000 - 500_000 - 10_000 - chan_feerate *
+ amount_satoshis: 1_000_000 - 500_000 - 10_000 - chan_feerate *
(channel::commitment_tx_base_weight(&channel_type_features) + 2 * channel::COMMITMENT_TX_WEIGHT_PER_HTLC) / 1000,
confirmation_height: node_a_commitment_claimable,
}, Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 10_000,
+ amount_satoshis: 10_000,
confirmation_height: core::cmp::max(as_timeout_claimable_height, htlc_cltv_timeout),
}]),
sorted_vec(nodes[0].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
connect_blocks(&nodes[0], node_a_commitment_claimable - nodes[0].best_block_info().1);
assert_eq!(vec![Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 10_000,
+ amount_satoshis: 10_000,
confirmation_height: core::cmp::max(as_timeout_claimable_height, htlc_cltv_timeout),
}],
nodes[0].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances());
mine_transaction(&nodes[1], &bs_htlc_timeout_claim[0]);
let bs_timeout_claimable_height = nodes[1].best_block_info().1 + ANTI_REORG_DELAY - 1;
assert_eq!(sorted_vec(vec![b_received_htlc_balance.clone(), Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 20_000,
+ amount_satoshis: 20_000,
confirmation_height: bs_timeout_claimable_height,
}]),
sorted_vec(nodes[1].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
mine_transaction(&nodes[1], &as_htlc_timeout_claim[0]);
assert_eq!(sorted_vec(vec![b_received_htlc_balance.clone(), Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 20_000,
+ amount_satoshis: 20_000,
confirmation_height: bs_timeout_claimable_height,
}]),
sorted_vec(nodes[1].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
// Prior to channel closure, B considers the preimage HTLC as its own, and otherwise only
// lists the two on-chain timeout-able HTLCs as claimable balances.
assert_eq!(sorted_vec(vec![Balance::ClaimableOnChannelClose {
- claimable_amount_satoshis: 100_000 - 5_000 - 4_000 - 3 - 2_000 + 3_000,
+ amount_satoshis: 100_000 - 5_000 - 4_000 - 3 - 2_000 + 3_000,
}, Balance::MaybeTimeoutClaimableHTLC {
- claimable_amount_satoshis: 2_000,
+ amount_satoshis: 2_000,
claimable_height: missing_htlc_cltv_timeout,
payment_hash: missing_htlc_payment_hash,
}, Balance::MaybeTimeoutClaimableHTLC {
- claimable_amount_satoshis: 4_000,
+ amount_satoshis: 4_000,
claimable_height: htlc_cltv_timeout,
payment_hash: timeout_payment_hash,
}, Balance::MaybeTimeoutClaimableHTLC {
- claimable_amount_satoshis: 5_000,
+ amount_satoshis: 5_000,
claimable_height: live_htlc_cltv_timeout,
payment_hash: live_payment_hash,
}]),
// claim balances separated out.
let expected_balance = vec![Balance::ClaimableAwaitingConfirmations {
// to_remote output in A's revoked commitment
- claimable_amount_satoshis: 100_000 - 5_000 - 4_000 - 3,
+ amount_satoshis: 100_000 - 5_000 - 4_000 - 3,
confirmation_height: nodes[1].best_block_info().1 + 5,
}, Balance::CounterpartyRevokedOutputClaimable {
- claimable_amount_satoshis: 3_000,
+ amount_satoshis: 3_000,
}, Balance::CounterpartyRevokedOutputClaimable {
- claimable_amount_satoshis: 4_000,
+ amount_satoshis: 4_000,
}];
let to_self_unclaimed_balance = Balance::CounterpartyRevokedOutputClaimable {
- claimable_amount_satoshis: 1_000_000 - 100_000 - 3_000 - chan_feerate *
+ amount_satoshis: 1_000_000 - 100_000 - 3_000 - chan_feerate *
(channel::commitment_tx_base_weight(&channel_type_features) + 3 * channel::COMMITMENT_TX_WEIGHT_PER_HTLC) / 1000,
};
let to_self_claimed_avail_height;
let largest_htlc_unclaimed_balance = Balance::CounterpartyRevokedOutputClaimable {
- claimable_amount_satoshis: 5_000,
+ amount_satoshis: 5_000,
};
let largest_htlc_claimed_avail_height;
}
let largest_htlc_claimed_balance = Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 5_000 - chan_feerate * INBOUND_HTLC_CLAIM_EXP_WEIGHT as u64 / 1000,
+ amount_satoshis: 5_000 - chan_feerate * INBOUND_HTLC_CLAIM_EXP_WEIGHT as u64 / 1000,
confirmation_height: largest_htlc_claimed_avail_height,
};
let to_self_claimed_balance = Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 1_000_000 - 100_000 - 3_000 - chan_feerate *
+ amount_satoshis: 1_000_000 - 100_000 - 3_000 - chan_feerate *
(channel::commitment_tx_base_weight(&channel_type_features) + 3 * channel::COMMITMENT_TX_WEIGHT_PER_HTLC) / 1000
- chan_feerate * claim_txn[3].weight() as u64 / 1000,
confirmation_height: to_self_claimed_avail_height,
assert_eq!(sorted_vec(vec![Balance::ClaimableAwaitingConfirmations {
// to_remote output in A's revoked commitment
- claimable_amount_satoshis: 100_000 - 5_000 - 4_000 - 3,
+ amount_satoshis: 100_000 - 5_000 - 4_000 - 3,
confirmation_height: nodes[1].best_block_info().1 + 1,
}, Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 1_000_000 - 100_000 - 3_000 - chan_feerate *
+ amount_satoshis: 1_000_000 - 100_000 - 3_000 - chan_feerate *
(channel::commitment_tx_base_weight(&channel_type_features) + 3 * channel::COMMITMENT_TX_WEIGHT_PER_HTLC) / 1000
- chan_feerate * claim_txn[3].weight() as u64 / 1000,
confirmation_height: to_self_claimed_avail_height,
}, Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 3_000 - chan_feerate * OUTBOUND_HTLC_CLAIM_EXP_WEIGHT as u64 / 1000,
+ amount_satoshis: 3_000 - chan_feerate * OUTBOUND_HTLC_CLAIM_EXP_WEIGHT as u64 / 1000,
confirmation_height: nodes[1].best_block_info().1 + 4,
}, Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 4_000 - chan_feerate * INBOUND_HTLC_CLAIM_EXP_WEIGHT as u64 / 1000,
+ amount_satoshis: 4_000 - chan_feerate * INBOUND_HTLC_CLAIM_EXP_WEIGHT as u64 / 1000,
confirmation_height: nodes[1].best_block_info().1 + 5,
}, Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: 5_000 - chan_feerate * INBOUND_HTLC_CLAIM_EXP_WEIGHT as u64 / 1000,
+ amount_satoshis: 5_000 - chan_feerate * INBOUND_HTLC_CLAIM_EXP_WEIGHT as u64 / 1000,
confirmation_height: largest_htlc_claimed_avail_height,
}]),
sorted_vec(nodes[1].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
// `CounterpartyRevokedOutputClaimable` entry doesn't change.
let as_balances = sorted_vec(vec![Balance::ClaimableAwaitingConfirmations {
// to_remote output in B's revoked commitment
- claimable_amount_satoshis: 1_000_000 - 11_000 - 3_000 - chan_feerate *
+ amount_satoshis: 1_000_000 - 11_000 - 3_000 - chan_feerate *
(channel::commitment_tx_base_weight(&channel_type_features) + 2 * channel::COMMITMENT_TX_WEIGHT_PER_HTLC) / 1000,
confirmation_height: to_remote_conf_height,
}, Balance::CounterpartyRevokedOutputClaimable {
// to_self output in B's revoked commitment
- claimable_amount_satoshis: 10_000,
+ amount_satoshis: 10_000,
}, Balance::CounterpartyRevokedOutputClaimable { // HTLC 1
- claimable_amount_satoshis: 3_000,
+ amount_satoshis: 3_000,
}, Balance::CounterpartyRevokedOutputClaimable { // HTLC 2
- claimable_amount_satoshis: 1_000,
+ amount_satoshis: 1_000,
}]);
assert_eq!(as_balances,
sorted_vec(nodes[0].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
mine_transaction(&nodes[0], &as_htlc_claim_tx[0]);
assert_eq!(sorted_vec(vec![Balance::ClaimableAwaitingConfirmations {
// to_remote output in B's revoked commitment
- claimable_amount_satoshis: 1_000_000 - 11_000 - 3_000 - chan_feerate *
+ amount_satoshis: 1_000_000 - 11_000 - 3_000 - chan_feerate *
(channel::commitment_tx_base_weight(&channel_type_features) + 2 * channel::COMMITMENT_TX_WEIGHT_PER_HTLC) / 1000,
confirmation_height: to_remote_conf_height,
}, Balance::CounterpartyRevokedOutputClaimable {
// to_self output in B's revoked commitment
- claimable_amount_satoshis: 10_000,
+ amount_satoshis: 10_000,
}, Balance::CounterpartyRevokedOutputClaimable { // HTLC 2
- claimable_amount_satoshis: 1_000,
+ amount_satoshis: 1_000,
}, Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: as_htlc_claim_tx[0].output[0].value,
+ amount_satoshis: as_htlc_claim_tx[0].output[0].value,
confirmation_height: nodes[0].best_block_info().1 + ANTI_REORG_DELAY - 1,
}]),
sorted_vec(nodes[0].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
test_spendable_output(&nodes[0], &revoked_local_txn[0]);
assert_eq!(sorted_vec(vec![Balance::CounterpartyRevokedOutputClaimable {
// to_self output to B
- claimable_amount_satoshis: 10_000,
+ amount_satoshis: 10_000,
}, Balance::CounterpartyRevokedOutputClaimable { // HTLC 2
- claimable_amount_satoshis: 1_000,
+ amount_satoshis: 1_000,
}, Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: as_htlc_claim_tx[0].output[0].value,
+ amount_satoshis: as_htlc_claim_tx[0].output[0].value,
confirmation_height: nodes[0].best_block_info().1 + 2,
}]),
sorted_vec(nodes[0].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
test_spendable_output(&nodes[0], &as_htlc_claim_tx[0]);
assert_eq!(sorted_vec(vec![Balance::CounterpartyRevokedOutputClaimable {
// to_self output in B's revoked commitment
- claimable_amount_satoshis: 10_000,
+ amount_satoshis: 10_000,
}, Balance::CounterpartyRevokedOutputClaimable { // HTLC 2
- claimable_amount_satoshis: 1_000,
+ amount_satoshis: 1_000,
}]),
sorted_vec(nodes[0].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
connect_blocks(&nodes[0], ANTI_REORG_DELAY - 1);
assert_eq!(sorted_vec(vec![Balance::CounterpartyRevokedOutputClaimable {
// to_self output in B's revoked commitment
- claimable_amount_satoshis: 10_000,
+ amount_satoshis: 10_000,
}, Balance::CounterpartyRevokedOutputClaimable { // HTLC 2
- claimable_amount_satoshis: 1_000,
+ amount_satoshis: 1_000,
}]),
sorted_vec(nodes[0].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
mine_transaction(&nodes[0], &as_second_htlc_claim_tx[0]);
assert_eq!(sorted_vec(vec![Balance::CounterpartyRevokedOutputClaimable {
// to_self output in B's revoked commitment
- claimable_amount_satoshis: 10_000,
+ amount_satoshis: 10_000,
}, Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: as_second_htlc_claim_tx[0].output[0].value,
+ amount_satoshis: as_second_htlc_claim_tx[0].output[0].value,
confirmation_height: nodes[0].best_block_info().1 + ANTI_REORG_DELAY - 1,
}]),
sorted_vec(nodes[0].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
mine_transaction(&nodes[0], &as_second_htlc_claim_tx[1]);
assert_eq!(sorted_vec(vec![Balance::ClaimableAwaitingConfirmations {
// to_self output in B's revoked commitment
- claimable_amount_satoshis: as_second_htlc_claim_tx[1].output[0].value,
+ amount_satoshis: as_second_htlc_claim_tx[1].output[0].value,
confirmation_height: nodes[0].best_block_info().1 + ANTI_REORG_DELAY - 1,
}, Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: as_second_htlc_claim_tx[0].output[0].value,
+ amount_satoshis: as_second_htlc_claim_tx[0].output[0].value,
confirmation_height: nodes[0].best_block_info().1 + ANTI_REORG_DELAY - 2,
}]),
sorted_vec(nodes[0].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
let _a_htlc_msgs = get_htlc_update_msgs!(&nodes[0], nodes[1].node.get_our_node_id());
assert_eq!(sorted_vec(vec![Balance::ClaimableOnChannelClose {
- claimable_amount_satoshis: 100_000 - 4_000 - 3_000,
+ amount_satoshis: 100_000 - 4_000 - 3_000,
}, Balance::MaybeTimeoutClaimableHTLC {
- claimable_amount_satoshis: 4_000,
+ amount_satoshis: 4_000,
claimable_height: htlc_cltv_timeout,
payment_hash: revoked_payment_hash,
}, Balance::MaybeTimeoutClaimableHTLC {
- claimable_amount_satoshis: 3_000,
+ amount_satoshis: 3_000,
claimable_height: htlc_cltv_timeout,
payment_hash: claimed_payment_hash,
}]),
assert_eq!(sorted_vec(vec![Balance::ClaimableAwaitingConfirmations {
// to_remote output in A's revoked commitment
- claimable_amount_satoshis: 100_000 - 4_000 - 3_000,
+ amount_satoshis: 100_000 - 4_000 - 3_000,
confirmation_height: to_remote_maturity,
}, Balance::CounterpartyRevokedOutputClaimable {
// to_self output in A's revoked commitment
- claimable_amount_satoshis: 1_000_000 - 100_000 - chan_feerate *
+ amount_satoshis: 1_000_000 - 100_000 - chan_feerate *
(channel::commitment_tx_base_weight(&channel_type_features) + 2 * channel::COMMITMENT_TX_WEIGHT_PER_HTLC) / 1000,
}, Balance::CounterpartyRevokedOutputClaimable { // HTLC 1
- claimable_amount_satoshis: 4_000,
+ amount_satoshis: 4_000,
}, Balance::CounterpartyRevokedOutputClaimable { // HTLC 2
- claimable_amount_satoshis: 3_000,
+ amount_satoshis: 3_000,
}]),
sorted_vec(nodes[1].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
assert_eq!(sorted_vec(vec![Balance::ClaimableAwaitingConfirmations {
// to_remote output in A's revoked commitment
- claimable_amount_satoshis: 100_000 - 4_000 - 3_000,
+ amount_satoshis: 100_000 - 4_000 - 3_000,
confirmation_height: to_remote_maturity,
}, Balance::CounterpartyRevokedOutputClaimable {
// to_self output in A's revoked commitment
- claimable_amount_satoshis: 1_000_000 - 100_000 - chan_feerate *
+ amount_satoshis: 1_000_000 - 100_000 - chan_feerate *
(channel::commitment_tx_base_weight(&channel_type_features) + 2 * channel::COMMITMENT_TX_WEIGHT_PER_HTLC) / 1000,
}, Balance::CounterpartyRevokedOutputClaimable { // HTLC 1
- claimable_amount_satoshis: 4_000,
+ amount_satoshis: 4_000,
}, Balance::CounterpartyRevokedOutputClaimable { // HTLC 2
// The amount here is a bit of a misnomer, really its been reduced by the HTLC
// transaction fee, but the claimable amount is always a bit of an overshoot for HTLCs
// anyway, so its not a big change.
- claimable_amount_satoshis: 3_000,
+ amount_satoshis: 3_000,
}]),
sorted_vec(nodes[1].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
assert_eq!(sorted_vec(vec![Balance::CounterpartyRevokedOutputClaimable {
// to_self output in A's revoked commitment
- claimable_amount_satoshis: 1_000_000 - 100_000 - chan_feerate *
+ amount_satoshis: 1_000_000 - 100_000 - chan_feerate *
(channel::commitment_tx_base_weight(&channel_type_features) + 2 * channel::COMMITMENT_TX_WEIGHT_PER_HTLC) / 1000,
}, Balance::CounterpartyRevokedOutputClaimable { // HTLC 1
- claimable_amount_satoshis: 4_000,
+ amount_satoshis: 4_000,
}, Balance::CounterpartyRevokedOutputClaimable { // HTLC 2
// The amount here is a bit of a misnomer, really its been reduced by the HTLC
// transaction fee, but the claimable amount is always a bit of an overshoot for HTLCs
// anyway, so its not a big change.
- claimable_amount_satoshis: 3_000,
+ amount_satoshis: 3_000,
}]),
sorted_vec(nodes[1].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
assert_eq!(sorted_vec(vec![Balance::CounterpartyRevokedOutputClaimable {
// to_self output in A's revoked commitment
- claimable_amount_satoshis: 1_000_000 - 100_000 - chan_feerate *
+ amount_satoshis: 1_000_000 - 100_000 - chan_feerate *
(channel::commitment_tx_base_weight(&channel_type_features) + 2 * channel::COMMITMENT_TX_WEIGHT_PER_HTLC) / 1000,
}, Balance::CounterpartyRevokedOutputClaimable { // HTLC 1
- claimable_amount_satoshis: 4_000,
+ amount_satoshis: 4_000,
}, Balance::ClaimableAwaitingConfirmations { // HTLC 2
- claimable_amount_satoshis: claim_txn_2[1].output[0].value,
+ amount_satoshis: claim_txn_2[1].output[0].value,
confirmation_height: htlc_2_claim_maturity,
}]),
sorted_vec(nodes[1].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
assert_eq!(sorted_vec(vec![Balance::CounterpartyRevokedOutputClaimable {
// to_self output in A's revoked commitment
- claimable_amount_satoshis: 1_000_000 - 100_000 - chan_feerate *
+ amount_satoshis: 1_000_000 - 100_000 - chan_feerate *
(channel::commitment_tx_base_weight(&channel_type_features) + 2 * channel::COMMITMENT_TX_WEIGHT_PER_HTLC) / 1000,
}, Balance::CounterpartyRevokedOutputClaimable { // HTLC 1
- claimable_amount_satoshis: 4_000,
+ amount_satoshis: 4_000,
}]),
sorted_vec(nodes[1].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances()));
let rest_claim_maturity = nodes[1].best_block_info().1 + ANTI_REORG_DELAY - 1;
assert_eq!(vec![Balance::ClaimableAwaitingConfirmations {
- claimable_amount_satoshis: claim_txn_2[0].output[0].value,
+ amount_satoshis: claim_txn_2[0].output[0].value,
confirmation_height: rest_claim_maturity,
}],
nodes[1].chain_monitor.chain_monitor.get_monitor(funding_outpoint).unwrap().get_claimable_balances());