mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-28 14:40:51 +02:00
multi: break ChannelConstraints into two sub-structures
This commit breaks the ChannelConstraints structure into two sub-structures that reflect the fundamental differences in how these parameters are used. On its face it may not seem necessary, however the distinction introduced here is relevant for how we will be implementing the Dynamic Commitments proposal.
This commit is contained in:
@@ -138,24 +138,28 @@ func createTestChannel(t *testing.T, alicePrivKey, bobPrivKey []byte,
|
||||
csvTimeoutBob := uint32(4)
|
||||
isAliceInitiator := true
|
||||
|
||||
aliceConstraints := &channeldb.ChannelConstraints{
|
||||
DustLimit: btcutil.Amount(200),
|
||||
aliceBounds := channeldb.ChannelStateBounds{
|
||||
MaxPendingAmount: lnwire.NewMSatFromSatoshis(
|
||||
channelCapacity),
|
||||
ChanReserve: aliceReserve,
|
||||
MinHTLC: 0,
|
||||
MaxAcceptedHtlcs: input.MaxHTLCNumber / 2,
|
||||
CsvDelay: uint16(csvTimeoutAlice),
|
||||
}
|
||||
aliceCommitParams := channeldb.CommitmentParams{
|
||||
DustLimit: btcutil.Amount(200),
|
||||
CsvDelay: uint16(csvTimeoutAlice),
|
||||
}
|
||||
|
||||
bobConstraints := &channeldb.ChannelConstraints{
|
||||
DustLimit: btcutil.Amount(800),
|
||||
bobBounds := channeldb.ChannelStateBounds{
|
||||
MaxPendingAmount: lnwire.NewMSatFromSatoshis(
|
||||
channelCapacity),
|
||||
ChanReserve: bobReserve,
|
||||
MinHTLC: 0,
|
||||
MaxAcceptedHtlcs: input.MaxHTLCNumber / 2,
|
||||
CsvDelay: uint16(csvTimeoutBob),
|
||||
}
|
||||
bobCommitParams := channeldb.CommitmentParams{
|
||||
DustLimit: btcutil.Amount(800),
|
||||
CsvDelay: uint16(csvTimeoutBob),
|
||||
}
|
||||
|
||||
var hash [sha256.Size]byte
|
||||
@@ -172,7 +176,8 @@ func createTestChannel(t *testing.T, alicePrivKey, bobPrivKey []byte,
|
||||
fundingTxIn := wire.NewTxIn(prevOut, nil, nil)
|
||||
|
||||
aliceCfg := channeldb.ChannelConfig{
|
||||
ChannelConstraints: *aliceConstraints,
|
||||
ChannelStateBounds: aliceBounds,
|
||||
CommitmentParams: aliceCommitParams,
|
||||
MultiSigKey: keychain.KeyDescriptor{
|
||||
PubKey: aliceKeyPub,
|
||||
},
|
||||
@@ -190,7 +195,8 @@ func createTestChannel(t *testing.T, alicePrivKey, bobPrivKey []byte,
|
||||
},
|
||||
}
|
||||
bobCfg := channeldb.ChannelConfig{
|
||||
ChannelConstraints: *bobConstraints,
|
||||
ChannelStateBounds: bobBounds,
|
||||
CommitmentParams: bobCommitParams,
|
||||
MultiSigKey: keychain.KeyDescriptor{
|
||||
PubKey: bobKeyPub,
|
||||
},
|
||||
|
Reference in New Issue
Block a user