mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-10 18:03:08 +02:00
funding: disallow channel creation before lnd is synced to the chain
This commit adds a new restriction around funding channels at the daemon level: lnd nodes will not allow either the initiation or the acceptance of a channel before the node is fully synced to the best known chain. This fixes a class of bug that arises when a new node joins the network and either attempts to open a channel or has a channel extended to them before the node is fully synced to the network.
This commit is contained in:
@@ -236,7 +236,7 @@ func testBasicChannelFunding(net *networkHarness, t *harnessTest) {
|
||||
}
|
||||
if bobBal.Balance != int64(pushAmt) {
|
||||
t.Fatalf("bob's balance is incorrect: expected %v got %v",
|
||||
pushAmt, bobBal)
|
||||
pushAmt, bobBal.Balance)
|
||||
}
|
||||
|
||||
// Finally, immediately close the channel. This function will also
|
||||
@@ -1124,7 +1124,7 @@ func testMaxPendingChannels(net *networkHarness, t *harnessTest) {
|
||||
_, err = net.OpenChannel(ctx, net.Alice, carol, amount, 0, 1)
|
||||
if err == nil {
|
||||
t.Fatalf("error wasn't received")
|
||||
} else if grpc.Code(err) != lnwire.ErrorMaxPendingChannels.ToGrpcCode() {
|
||||
} else if grpc.Code(err) != lnwire.ErrMaxPendingChannels.ToGrpcCode() {
|
||||
t.Fatalf("not expected error was received: %v", err)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user