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:
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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user