mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-23 03:15:27 +02:00
lnwallet: Change channel update methods to accept HTLC ID.
Previously, some methods on a LightningChannel like SettleHTLC and FailHTLC would identify HTLCs by payment hash. This would not always work correctly if there are multiple HTLCs with the same payment hash, so instead we change these methods to identify HTLCs by their unique identifiers instead.
This commit is contained in:
committed by
Olaoluwa Osuntokun
parent
1328e61c00
commit
317b44e220
@@ -1583,6 +1583,7 @@ func TestChannelLinkBandwidthConsistency(t *testing.T) {
|
||||
// remain unchanged (but Alice will need to pay the fee for the extra
|
||||
// HTLC).
|
||||
updateMsg := &lnwire.UpdateAddHTLC{
|
||||
ID: 0,
|
||||
Amount: htlcAmt,
|
||||
Expiry: 9,
|
||||
PaymentHash: htlc.PaymentHash, // Re-using the same payment hash.
|
||||
@@ -1607,6 +1608,7 @@ func TestChannelLinkBandwidthConsistency(t *testing.T) {
|
||||
// Finally, we'll test the scenario of failing an HTLC received by the
|
||||
// remote node. This should result in no perceived bandwidth changes.
|
||||
htlcAdd := &lnwire.UpdateAddHTLC{
|
||||
ID: 1,
|
||||
Amount: htlcAmt,
|
||||
Expiry: 9,
|
||||
PaymentHash: htlc.PaymentHash,
|
||||
|
Reference in New Issue
Block a user