mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2026-02-20 14:04:23 +01:00
lnwallet: check for correct value in HTLC outputs in commitment transaction
It is possible that that there are multiple HTLCs with different values, but the same public key script. As such, a check against the value should be performed when looking for HTLC outputs in a commitment transaction.
This commit is contained in:
committed by
Olaoluwa Osuntokun
parent
17d29ba62e
commit
d958ea005f
@@ -276,7 +276,8 @@ func (c *commitment) toChannelDelta(ourCommit bool) (*channeldb.ChannelDelta, er
|
||||
pkScript = p.ourPkScript
|
||||
}
|
||||
for i, txOut := range c.txn.TxOut {
|
||||
if bytes.Equal(txOut.PkScript, pkScript) {
|
||||
if bytes.Equal(txOut.PkScript, pkScript) &&
|
||||
txOut.Value == int64(p.Amount) {
|
||||
if contains(dups[p.RHash], uint16(i)) {
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user