fundingmanager+lnwallet: add HTLC dust limit logic

This commit is contained in:
Andrey Samokhvalov authored and Olaoluwa Osuntokun committed 2016-12-13 11:01:57 -08:00
1 parent c731156ac8
commit d01f1b5ff4
9 files changed
+188 -35

No files matched your search

+8 -8
View File
@@ -363,7 +363,7 @@ func testDualFundingReservationWorkflow(miner *rpctest.Harness, wallet *lnwallet
// Bob initiates a channel funded with 5 BTC for each side, so 10
// BTC total. He also generates 2 BTC in change.
chanReservation, err := wallet.InitChannelReservation(fundingAmount*2,
fundingAmount, bobNode.id, bobAddr, numReqConfs, 4)
fundingAmount, bobNode.id, bobAddr, numReqConfs, 4, 540)
if err != nil {
t.Fatalf("unable to initialize funding reservation: %v", err)
}
@@ -522,7 +522,7 @@ func testFundingTransactionLockedOutputs(miner *rpctest.Harness,
// Create a single channel asking for 16 BTC total.
fundingAmount := btcutil.Amount(8 * 1e8)
_, err := wallet.InitChannelReservation(fundingAmount, fundingAmount,
testPub, bobAddr, numReqConfs, 4)
testPub, bobAddr, numReqConfs, 4, 540)
if err != nil {
t.Fatalf("unable to initialize funding reservation 1: %v", err)
}
@@ -532,7 +532,7 @@ func testFundingTransactionLockedOutputs(miner *rpctest.Harness,
// that aren't locked, so this should fail.
amt := btcutil.Amount(900 * 1e8)
failedReservation, err := wallet.InitChannelReservation(amt, amt,
testPub, bobAddr, numReqConfs, 4)
testPub, bobAddr, numReqConfs, 4, 540)
if err == nil {
t.Fatalf("not error returned, should fail on coin selection")
}
@@ -552,14 +552,14 @@ func testFundingCancellationNotEnoughFunds(miner *rpctest.Harness,
// Create a reservation for 44 BTC.
fundingAmount := btcutil.Amount(44 * 1e8)
chanReservation, err := wallet.InitChannelReservation(fundingAmount,
fundingAmount, testPub, bobAddr, numReqConfs, 4)
fundingAmount, testPub, bobAddr, numReqConfs, 4, 540)
if err != nil {
t.Fatalf("unable to initialize funding reservation: %v", err)
}
// Attempt to create another channel with 44 BTC, this should fail.
_, err = wallet.InitChannelReservation(fundingAmount,
fundingAmount, testPub, bobAddr, numReqConfs, 4)
fundingAmount, testPub, bobAddr, numReqConfs, 4, 540)
if _, ok := err.(*lnwallet.ErrInsufficientFunds); !ok {
t.Fatalf("coin selection succeded should have insufficient funds: %v",
err)
@@ -589,7 +589,7 @@ func testFundingCancellationNotEnoughFunds(miner *rpctest.Harness,
// Request to fund a new channel should now succeed.
_, err = wallet.InitChannelReservation(fundingAmount, fundingAmount,
testPub, bobAddr, numReqConfs, 4)
testPub, bobAddr, numReqConfs, 4, 540)
if err != nil {
t.Fatalf("unable to initialize funding reservation: %v", err)
}
@@ -628,7 +628,7 @@ func testSingleFunderReservationWorkflowInitiator(miner *rpctest.Harness,
// Initialize a reservation for a channel with 4 BTC funded solely by us.
fundingAmt := btcutil.Amount(4 * 1e8)
chanReservation, err := lnwallet.InitChannelReservation(fundingAmt,
fundingAmt, bobNode.id, bobAddr, numReqConfs, 4)
fundingAmt, bobNode.id, bobAddr, numReqConfs, 4, 540)
if err != nil {
t.Fatalf("unable to init channel reservation: %v", err)
}
@@ -769,7 +769,7 @@ func testSingleFunderReservationWorkflowResponder(miner *rpctest.Harness,
// contribution and the necessary resources.
fundingAmt := btcutil.Amount(0)
chanReservation, err := wallet.InitChannelReservation(capacity,
fundingAmt, bobNode.id, bobAddr, numReqConfs, 4)
fundingAmt, bobNode.id, bobAddr, numReqConfs, 4, 540)
if err != nil {
t.Fatalf("unable to init channel reservation: %v", err)
}