Commit Graph

30 Commits

Author SHA1 Message Date
Keagan McClelland
dad53b3f9a Revert "feature: make gossip queries compulsory"
This reverts commit 717facc202.

It turns out that we can't do this since it would result in
incompatibility with LDK. The spec has been updated to reallow
optional gossip queries so we revert this commit.
2024-04-02 16:43:27 -07:00
Keagan McClelland
db39a905cb multi: make NewChanIDFromOutpoint accept value instead of pointer 2024-03-08 15:47:55 -08:00
Keagan McClelland
fd1cd315ce multi: don't leak underlying pointer to LightningChannel.ChannelPoint() 2024-03-08 15:27:19 -08:00
Keagan McClelland
317aaf9940 peer: fix issue where we echo remote Shutdown 2024-01-30 12:15:59 -05:00
ziggie
3530254ff4
peer: add unit test.
Add a unit test for the removal of a pending channel.
2024-01-22 13:01:42 +00:00
Keagan McClelland
717facc202 feature: make gossip queries compulsory 2024-01-11 13:57:56 -08:00
Matt Morehouse
f0ae5b2456
peer: add test for startup race on writeMessage
The test reliably detects
https://github.com/lightningnetwork/lnd/issues/8184.
2023-11-16 17:33:44 -06:00
Carla Kirk-Cohen
a8a86b290c
peer/test: setup clean peer for each TestHandleNewPendingChannel case
Running test cases in parallel with shared state means that they
can intermingle if they're run at the same time and set up incorrect
values when we assert on the number of channels we have. Moving the
peer setup into the parallel test run fixes this because no single
test case can interfere with the other.
2023-11-14 15:45:19 -05:00
yyforyongyu
839b6271e5
peer: fix unit test flake 2023-10-13 13:50:07 +08:00
yyforyongyu
6b41289538
multi: patch unit tests for handling pending channels 2023-08-09 01:29:19 +08:00
yyforyongyu
d28242c664
peer: return an error from updateNextRevocation and patch unit tests
This commit makes the `updateNextRevocation` to return an error and
further feed it through the request's error chan so it'd be handled by
the caller.
2023-08-09 01:29:18 +08:00
yyforyongyu
2f9ba1594c
peer: retry enabling channels on ErrEnableInactiveChan
This commit adds a retry logic to the channels that failed with
`ErrEnableInactiveChan` when requesting enabling. We now subscribe the
channel events to decide what to do with the failed channels.
2023-01-18 03:46:16 +08:00
Eng Zer Jun
f8ae8318c6
peer: replace defer cleanup with t.Cleanup
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-10-13 17:47:03 +08:00
Eng Zer Jun
71185d46fb
peer: use T.TempDir to create temporary test directory
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-08-24 09:03:05 +08:00
Olaoluwa Osuntokun
fffad49ad1
peer: send taproot addrs during co-op close based on new feature bit
If the ShutdownAnySegwitOptional option is active, then we can safely
send these newer addresses.
2022-08-10 18:44:35 -07:00
Tommy Volk
834756c53c multi: migrate assert.NoError to require.NoError 2022-07-05 16:41:08 +00:00
Carsten Otto
ffe8b088d3 peer: add pubkey to log messages 2022-06-27 21:04:03 +02:00
Tommy Volk
9a10c80bcb multi: move many t.Fatalf calls to require.NoError 2022-06-17 04:26:55 +00:00
Oliver Gugger
7dfe4018ce
multi: use btcd's btcec/v2 and btcutil modules
This commit was previously split into the following parts to ease
review:
 - 2d746f68: replace imports
 - 4008f0fd: use ecdsa.Signature
 - 849e33d1: remove btcec.S256()
 - b8f6ebbd: use v2 library correctly
 - fa80bca9: bump go modules
2022-03-09 19:02:37 +01:00
Dimitris Apostolou
530a2059e5
multi: Fix typos [skip ci] 2022-01-24 12:19:02 +02:00
Olaoluwa Osuntokun
3481286ea0
lnwire+peer: clamp pong bytes, make ping handler more effcieint
This was not properly enforced and would be a spec violation on the
peer's end. Also re-use a pong buffer to save on heap allocations if
there are a lot of peers. The pong buffer is only read from, so this
is concurrent safe.
2022-01-13 15:01:18 -08:00
Joost Jager
ade50d0b2c
lnrpc: receive custom message 2021-10-15 17:08:55 +02:00
Joost Jager
ae959b16ae
lnrpc: send custom message 2021-10-15 17:08:53 +02:00
Olaoluwa Osuntokun
7bde1662e2
multi: move breach arbiter and utxo nursery into contractcourt package
In this commit, we take an initial step towards converting the existing
breach arbiter and utxo nursery logic into contract resolvers by moving
the files as is, into the `contractcourt` pacakge.

This commit is primarily move only, though we had to massage some
interfaces and config names along the way to make things compile and the
tests run properly.
2021-09-27 19:10:31 -07:00
eugene
aeaa009e92
peer+chancloser: tryLinkShutdown during cooperative close process
Adds a new Brontide struct method tryLinkShutdown that attempts to
fetch the target link and calls ShutdownIfChannelClean on it. This
allows the coop close process to guarantee atomicity of the underlying
channel state. Also removes the UnregisterChannel method from the
chancloser's config as the link is shut down before the chancloser
is created.
2021-09-13 13:29:51 -04:00
eugene
608d11dcbc
peer: add mockUpdateHandler for use in mockMessageSwitch 2021-09-13 13:29:50 -04:00
Olaoluwa Osuntokun
403d37f426
peer: ensure consistent local+global feature bits when downgrading
In this commit, we fix an issue that would cause peers running lnd 0.12
to not be able to connect to existing peers due to a feature bit
compatibility issue. In a recent PR we started to downgrade our required
feature bit for static key from required to optional, if we had a legacy
(non-tweakless) open with the peer then we would unset the required bit
and set the optional bit to ensure we could still connect to them.

The change implementing this new version of downgrade failed _also_
unset the bit (the required bit) in the "legacy global" feature bit
section. This caused the `RawFeatureVector.Merge` method to fail as we
would have the required bit set in the `GlobalFeatures` section, but the
optional bit set in the `Features` section. The `Merge` method ensures
that a required and optional bit can't be set in two different locations
for the same feature.

This PR fixes this issue by also unsetting the bit in the
`GlobalFeatures` field in the init message.

Fixes #4871
2020-12-17 17:04:15 -08:00
carla
7d1282af70
peer/test: add test for static key downgrade for legacy channels 2020-12-09 16:31:02 +02:00
eugene
c7cbacc35b multi: move mockChainIO, mockNotifier to lntest/mock 2020-08-31 19:41:09 -04:00
nsa
cbd54101f8 multi: remove peer.go, change all references to point to peer pkg 2020-07-06 19:16:07 -04:00