cnct: make original htlc amt available for contract resolvers

Previously, contract resolvers that needed to publish a second level tx,
did not have access to the original htlc amount.

This commit reconstructs this amount from data that is already persisted
in arbitrator log.

Co-authored-by: Joost Jager <joost.jager@gmail.com>
This commit is contained in:
Wilmer Paulino
2019-01-22 20:45:32 -08:00
parent 93754f8d37
commit 974e0f2df5
3 changed files with 109 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ package contractcourt
import (
"encoding/binary"
"fmt"
"github.com/lightningnetwork/lnd/lnwire"
"io"
"github.com/btcsuite/btcd/wire"
@@ -46,6 +47,10 @@ type htlcSuccessResolver struct {
// TODO(roasbeef): send off to utxobundler
sweepTx *wire.MsgTx
// htlcAmt is the original amount of the htlc, not taking into
// account any fees that may have to be paid if it goes on chain.
htlcAmt lnwire.MilliSatoshi
ResolverKit
}