mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-28 14:40:51 +02:00
Merge pull request #8953 from ProofOfKeags/refactor/lnwallet-channel-channel-constraints-partition
[MICRO]: multi: break ChannelConstraints into two sub-structures
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