]> git.bitcoin.ninja Git - ldk-sample/log
ldk-sample
5 weeks agoPrint network graph statistics in nodeinfo
Matt Corallo [Mon, 14 Oct 2024 02:40:36 +0000 (02:40 +0000)]
Print network graph statistics in nodeinfo

5 weeks agoUse `Balance`s to calculate balances instead of `ChannelDetails`
Matt Corallo [Mon, 14 Oct 2024 02:03:54 +0000 (02:03 +0000)]
Use `Balance`s to calculate balances instead of `ChannelDetails`

LDK has deprecated the `ChannelDetails` balance retrieval because
its generally not what users want. Instead, we use the
`ChainMonitor` `Balance` list.

5 weeks agoUpgrade to LDK 0.0.125/rust-bitcoin 0.32
Matt Corallo [Mon, 14 Oct 2024 01:29:25 +0000 (01:29 +0000)]
Upgrade to LDK 0.0.125/rust-bitcoin 0.32

5 weeks agoDrop `sendonionmessage` custom message sending command
Matt Corallo [Mon, 14 Oct 2024 00:27:14 +0000 (00:27 +0000)]
Drop `sendonionmessage` custom message sending command

Onion messages are now useful for various things so having a demo
use for them isn't all that interesting anymore.

4 months agoMerge pull request #134 from valentinewallace/2024-05-migrate-spendable-outputs
Elias Rohrer [Thu, 27 Jun 2024 13:55:17 +0000 (09:55 -0400)]
Merge pull request #134 from valentinewallace/2024-05-migrate-spendable-outputs

Migrate prior spendable outputs to `OutputSweeper`

4 months agoMigrate deprecated spendable outputs persistence.
Valentine Wallace [Tue, 28 May 2024 19:19:05 +0000 (15:19 -0400)]
Migrate deprecated spendable outputs persistence.

5 months agoMerge pull request #133 from valentinewallace/2024-04-0.0.123
Elias Rohrer [Wed, 29 May 2024 08:24:53 +0000 (10:24 +0200)]
Merge pull request #133 from valentinewallace/2024-04-0.0.123

Update to LDK 0.0.123

5 months agoUse new OutputSweeper to sweep spendable outputs.
Valentine Wallace [Tue, 7 May 2024 19:33:42 +0000 (15:33 -0400)]
Use new OutputSweeper to sweep spendable outputs.

5 months agoUpdate to LDK 0.0.123.
Valentine Wallace [Mon, 6 May 2024 16:25:51 +0000 (12:25 -0400)]
Update to LDK 0.0.123.

6 months agoMerge pull request #131 from tnull/2024-02-align-rustfmt
Matt Corallo [Thu, 25 Apr 2024 17:48:04 +0000 (10:48 -0700)]
Merge pull request #131 from tnull/2024-02-align-rustfmt

Align `rustfmt.toml` with `rust-lightning`

8 months agoMerge pull request #132 from tnull/2024-03-avoid-offer-hash-collision
Elias Rohrer [Sat, 9 Mar 2024 06:37:35 +0000 (07:37 +0100)]
Merge pull request #132 from tnull/2024-03-avoid-offer-hash-collision

8 months agoFix warning by including error in error prompt
Elias Rohrer [Fri, 8 Mar 2024 13:35:19 +0000 (14:35 +0100)]
Fix warning by including error in error prompt

8 months agoGenerate random `PaymentId` for outbound offers
Elias Rohrer [Fri, 8 Mar 2024 13:32:39 +0000 (14:32 +0100)]
Generate random `PaymentId` for outbound offers

Previously, we'd deterministically derive the `offer_hash` as a
`PaymentId` for outbound BOLT 12 payments. However, as offers may be
paid multiple times, this could result in collisions in our
`outbound_payments` store.

Here, we therefore use random `PaymentId`s to avoid collisions, even if
offers are paid multiple times.

9 months agoAlign `rustfmt.toml` with `rust-lightning`
Elias Rohrer [Fri, 23 Feb 2024 11:06:57 +0000 (12:06 +0100)]
Align `rustfmt.toml` with `rust-lightning`

Now that `rust-lightning` has added `rustfmt` support, we make sure our
coding style is aligned.

9 months agoMerge pull request #129 from TheBlueMatt/main
Elias Rohrer [Tue, 13 Feb 2024 09:18:42 +0000 (10:18 +0100)]
Merge pull request #129 from TheBlueMatt/main

Use PaymentParameters creation utility and support BOLT12

9 months agoSupport paying 0-amount offers and invoices
Matt Corallo [Tue, 6 Feb 2024 22:43:24 +0000 (22:43 +0000)]
Support paying 0-amount offers and invoices

9 months agoAdd BOLT12 Offer generation and payment support
Matt Corallo [Fri, 2 Feb 2024 20:57:52 +0000 (20:57 +0000)]
Add BOLT12 Offer generation and payment support

9 months agoHandle `Event::ConnectionNeeded` for onion message sending
Matt Corallo [Fri, 2 Feb 2024 20:56:55 +0000 (20:56 +0000)]
Handle `Event::ConnectionNeeded` for onion message sending

9 months agoUse `payment_parameters_from_invoice` rather than building by hand
Matt Corallo [Fri, 2 Feb 2024 20:04:18 +0000 (20:04 +0000)]
Use `payment_parameters_from_invoice` rather than building by hand

9 months agoMerge pull request #126 from optout21/ldk-119
Elias Rohrer [Thu, 1 Feb 2024 13:01:14 +0000 (14:01 +0100)]
Merge pull request #126 from optout21/ldk-119

Update to LDK 0.0.121

9 months agoUpdate to LDK 0.0.121
optout [Thu, 1 Feb 2024 12:22:54 +0000 (13:22 +0100)]
Update to LDK 0.0.121

12 months agoMerge pull request #123 from TheBlueMatt/main
Elias Rohrer [Tue, 14 Nov 2023 07:52:20 +0000 (08:52 +0100)]
Merge pull request #123 from TheBlueMatt/main

Upgrade to LDK 0.0.118

12 months agoDrop unused `hex` dependency
Matt Corallo [Sun, 15 Oct 2023 17:05:55 +0000 (17:05 +0000)]
Drop unused `hex` dependency

12 months agoSplit inbound+outbound payments, use PaymentId as outbound key
Matt Corallo [Mon, 18 Sep 2023 05:00:52 +0000 (05:00 +0000)]
Split inbound+outbound payments, use PaymentId as outbound key

12 months agoUpgrade LDK to 0.0.118
Matt Corallo [Sat, 30 Sep 2023 01:06:13 +0000 (01:06 +0000)]
Upgrade LDK to 0.0.118

12 months agoDrop unused `UtxoLookup` impl for `BitcoindClient`
Matt Corallo [Sat, 21 Oct 2023 22:12:02 +0000 (22:12 +0000)]
Drop unused `UtxoLookup` impl for `BitcoindClient`

12 months agoMerge pull request #124 from optout21/broadcast-comment
Matt Corallo [Fri, 27 Oct 2023 16:38:34 +0000 (16:38 +0000)]
Merge pull request #124 from optout21/broadcast-comment

[doc only] Fix comment on funding transaction broadcast

12 months agoFix comment on funding transaction broadcast
optout [Wed, 25 Oct 2023 08:36:28 +0000 (10:36 +0200)]
Fix comment on funding transaction broadcast

13 months agoMerge pull request #118 from TheBlueMatt/main
Elias Rohrer [Mon, 16 Oct 2023 06:47:35 +0000 (08:47 +0200)]
Merge pull request #118 from TheBlueMatt/main

Upgrade to LDK 0.0.117

13 months agoVerify gossip using our RpcClient and the new LDK verification impl
Matt Corallo [Sat, 30 Sep 2023 03:01:07 +0000 (03:01 +0000)]
Verify gossip using our RpcClient and the new LDK verification impl

13 months agoRename `persister` in `handle_ldk_events` to differentiate store
Matt Corallo [Sat, 30 Sep 2023 00:53:06 +0000 (00:53 +0000)]
Rename `persister` in `handle_ldk_events` to differentiate store

Since we now have a `Persist`er which is separate from our
`FilesystemStore`, its useful to use different names to
differentiate the two.

13 months agoSwitch to `MonitorUpdatingPersister`
Matt Corallo [Fri, 29 Sep 2023 05:07:26 +0000 (05:07 +0000)]
Switch to `MonitorUpdatingPersister`

13 months agoAvoid using `hex_str` for payment hashes which now impl Display
Matt Corallo [Mon, 18 Sep 2023 05:33:26 +0000 (05:33 +0000)]
Avoid using `hex_str` for payment hashes which now impl Display

13 months agoUpgrade to LDK 0.0.117
Matt Corallo [Mon, 18 Sep 2023 04:43:32 +0000 (04:43 +0000)]
Upgrade to LDK 0.0.117

13 months agoMerge pull request #120 from benthecarman/fee-sniping
Matt Corallo [Sun, 15 Oct 2023 17:05:06 +0000 (17:05 +0000)]
Merge pull request #120 from benthecarman/fee-sniping

Use bitcoin core's logic for anti-fee-sniping

13 months agoUse bitcoin core's logic for anti-fee-sniping
benthecarman [Mon, 25 Sep 2023 03:17:33 +0000 (22:17 -0500)]
Use bitcoin core's logic for anti-fee-sniping

14 months agoMerge pull request #119 from benthecarman/rm-targe
Elias Rohrer [Thu, 21 Sep 2023 07:33:58 +0000 (09:33 +0200)]
Merge pull request #119 from benthecarman/rm-targe

Remove unneeded Target enum

14 months agoRemove unneeded Target enum
benthecarman [Mon, 18 Sep 2023 20:30:32 +0000 (15:30 -0500)]
Remove unneeded Target enum

14 months agoMerge pull request #117 from TheBlueMatt/main
Elias Rohrer [Wed, 30 Aug 2023 06:55:24 +0000 (08:55 +0200)]
Merge pull request #117 from TheBlueMatt/main

Sweep Fixes

15 months agoDont block tokio reactor waiting on user input
Matt Corallo [Tue, 22 Aug 2023 20:59:23 +0000 (20:59 +0000)]
Dont block tokio reactor waiting on user input

When we moved the CLI input reading into a `tokio::select`, we
ended up blocking the tokio reactor by reading from stdin in a
standard tokio future. Instead, we need to let tokio know that
we're running a largely-blocking task.

15 months agoCorrect directory path for spendables sweep
Matt Corallo [Sun, 20 Aug 2023 02:13:46 +0000 (02:13 +0000)]
Correct directory path for spendables sweep

15 months agoMerge pull request #114 from TheBlueMatt/2023-08-last-ditch-write
Matt Corallo [Mon, 14 Aug 2023 19:41:25 +0000 (19:41 +0000)]
Merge pull request #114 from TheBlueMatt/2023-08-last-ditch-write

Attempt a last-ditch ChannelManager persistence if the BP exits

15 months agoAttempt a last-ditch ChannelManager persistence if the BP exits 2023-08-last-ditch-write
Matt Corallo [Sun, 13 Aug 2023 22:40:25 +0000 (22:40 +0000)]
Attempt a last-ditch ChannelManager persistence if the BP exits

If the BP exits because it failed to write our ChannelManager to
disk, we'll probably lose some channels on startup. However,
there's still some chance for us to write the `ChannelManager` in a
retry, which we should do before we exit.

15 months agoMerge pull request #116 from wpaulino/anchors
Matt Corallo [Mon, 14 Aug 2023 18:47:11 +0000 (18:47 +0000)]
Merge pull request #116 from wpaulino/anchors

Add support for opening anchor outputs channels

15 months agoMerge pull request #112 from TheBlueMatt/main
Matt Corallo [Mon, 14 Aug 2023 16:51:47 +0000 (16:51 +0000)]
Merge pull request #112 from TheBlueMatt/main

Trim whitespace when signing messages

15 months agoAdd anchors flag to openchannel CLI command
Wilmer Paulino [Mon, 14 Aug 2023 16:03:00 +0000 (09:03 -0700)]
Add anchors flag to openchannel CLI command

15 months agoHandle Event::BumpTransaction via BumpTxEventHandler
Wilmer Paulino [Mon, 14 Aug 2023 16:02:18 +0000 (09:02 -0700)]
Handle Event::BumpTransaction via BumpTxEventHandler

15 months agoImplement bump_transaction::WalletSource for BitcoindClient
Wilmer Paulino [Mon, 14 Aug 2023 16:00:21 +0000 (09:00 -0700)]
Implement bump_transaction::WalletSource for BitcoindClient

`BitcoindClient` will be used as the view into the onchain wallet from
which we'll source UTXOs.

15 months agoManually accept inbound channels
Wilmer Paulino [Mon, 14 Aug 2023 15:57:45 +0000 (08:57 -0700)]
Manually accept inbound channels

Since we plan to add support for opening anchor outputs channels, we'll
need to support manually accepting inbound channels first to do so.

15 months agoTrim whitespace when signing messages
Matt Corallo [Fri, 11 Aug 2023 20:31:49 +0000 (20:31 +0000)]
Trim whitespace when signing messages

Fixes https://github.com/lightningdevkit/rust-lightning/issues/2188

15 months agoMerge pull request #109 from valentinewallace/2023-07-detect-bgproc-exit
Jeffrey Czyz [Mon, 7 Aug 2023 19:35:09 +0000 (14:35 -0500)]
Merge pull request #109 from valentinewallace/2023-07-detect-bgproc-exit

Detect if the background processor exits early and shutdown if so

15 months agoMerge pull request #110 from tnull/2023-08-no-chrono-default-features
Matt Corallo [Mon, 7 Aug 2023 03:05:42 +0000 (03:05 +0000)]
Merge pull request #110 from tnull/2023-08-no-chrono-default-features

15 months agoDon't use `chrono` default features
Elias Rohrer [Sun, 6 Aug 2023 17:00:50 +0000 (19:00 +0200)]
Don't use `chrono` default features

The `chrono` crate has a dependency on an old version of `time` which
has a potential segfault. We therefore disable the default features.

15 months agoDetect if the background processor exits early and shutdown if so
Valentine Wallace [Thu, 3 Aug 2023 21:22:25 +0000 (14:22 -0700)]
Detect if the background processor exits early and shutdown if so

15 months agoMerge pull request #107 from tnull/2023-07-upgrade-to-0.0.116
Matt Corallo [Sun, 30 Jul 2023 22:34:59 +0000 (22:34 +0000)]
Merge pull request #107 from tnull/2023-07-upgrade-to-0.0.116

Upgrade to LDK 0.0.116

15 months agoUpgrade to LDK 0.0.116
Elias Rohrer [Fri, 7 Jul 2023 12:44:07 +0000 (14:44 +0200)]
Upgrade to LDK 0.0.116

15 months agoMerge pull request #104 from zoedberg/persist_payments
Matt Corallo [Tue, 25 Jul 2023 18:37:07 +0000 (18:37 +0000)]
Merge pull request #104 from zoedberg/persist_payments

persist payments info to disk

16 months agopersist payments info to disk
Zoe Faltibà [Wed, 10 May 2023 15:40:47 +0000 (17:40 +0200)]
persist payments info to disk

16 months agoMerge pull request #106 from tnull/2023-07-fix-github-actions
Matt Corallo [Fri, 14 Jul 2023 00:14:33 +0000 (00:14 +0000)]
Merge pull request #106 from tnull/2023-07-fix-github-actions

Update CI to remove deprecated actions

16 months agoMerge pull request #108 from domZippilli/2023-07-relax-peer-reconnect-tick-behavior
Matt Corallo [Wed, 12 Jul 2023 19:31:54 +0000 (19:31 +0000)]
Merge pull request #108 from domZippilli/2023-07-relax-peer-reconnect-tick-behavior

Switch missed tick behavior to delay instead of default burst

16 months agoswitch missed tick behavior to delay instead of default burst
Dom Zippilli [Wed, 12 Jul 2023 18:54:10 +0000 (11:54 -0700)]
switch missed tick behavior to delay instead of default burst

16 months agoUpdate CI to remove deprecated actions
Elias Rohrer [Thu, 6 Jul 2023 12:41:48 +0000 (14:41 +0200)]
Update CI to remove deprecated actions

18 months agoMerge pull request #103 from TheBlueMatt/main
Elias Rohrer [Fri, 19 May 2023 12:40:07 +0000 (14:40 +0200)]
Merge pull request #103 from TheBlueMatt/main

Make SpendableOutput claims more robust

18 months agoTry to sweep `SpendableOutputs` regularly, and in bulk
Matt Corallo [Sun, 7 May 2023 18:12:20 +0000 (18:12 +0000)]
Try to sweep `SpendableOutputs` regularly, and in bulk

Rather than trying to sweep `SpendableOutputs` every time we see
one, try to sweep them in bulk once an hour. Then, try to sweep
them repeatedly every hour forever, even after they're claimed.

Fixes #102.

18 months agoAnnounce node_announcemnet even without listen addresses
Matt Corallo [Sun, 7 May 2023 03:20:08 +0000 (03:20 +0000)]
Announce node_announcemnet even without listen addresses

Even if we don't have any listen addresses, it's still useful to
broadcast a node_announcement to get our node_features out there.

Here we do this and also improve the timing of our
node_announcement updates to be less spammy.

18 months agoMerge pull request #100 from TheBlueMatt/main
Elias Rohrer [Wed, 26 Apr 2023 09:25:39 +0000 (11:25 +0200)]
Merge pull request #100 from TheBlueMatt/main

Update to LDK 0.0.115

18 months agoDrop windows-latest stable rustc build as it now fails
Matt Corallo [Wed, 26 Apr 2023 00:56:58 +0000 (00:56 +0000)]
Drop windows-latest stable rustc build as it now fails

Needs a backport of the fixes in [1] to ntapi 0.3.

[1] https://github.com/MSxDOS/ntapi/issues/15

18 months agoUpdate Cargo.lock
Matt Corallo [Wed, 26 Apr 2023 00:25:20 +0000 (00:25 +0000)]
Update Cargo.lock

19 months agoLog ChannelPending events
Matt Corallo [Tue, 25 Apr 2023 05:57:00 +0000 (05:57 +0000)]
Log ChannelPending events

19 months agoPrint the ultimate payment failure reason on PaymentFailed events
Matt Corallo [Mon, 24 Apr 2023 15:52:24 +0000 (15:52 +0000)]
Print the ultimate payment failure reason on PaymentFailed events

19 months agoSwitch to using the async background processor
Matt Corallo [Mon, 24 Apr 2023 03:21:42 +0000 (03:21 +0000)]
Switch to using the async background processor

This drops a full thread from the sample node and better integrates
LDK into the tokio runtime. While we're at it we also push the
`Event` being processed by move into the event handler, which
doesn't matter much here but makes further modification in the
event handling somewhat simpler.

19 months agoUpdate to LDK 0.0.115
Matt Corallo [Sun, 23 Apr 2023 17:12:40 +0000 (17:12 +0000)]
Update to LDK 0.0.115

19 months agoDrop `futures` dependency with `tokio::select`
Matt Corallo [Sun, 23 Apr 2023 17:03:57 +0000 (17:03 +0000)]
Drop `futures` dependency with `tokio::select`

Manually poll'ing a future every 10ms rather than selecting across
it and a timer is less effecient, and certainly not worth taking a
dependency to do.

19 months agoMerge pull request #99 from TheBlueMatt/main
Elias Rohrer [Mon, 27 Mar 2023 11:56:07 +0000 (13:56 +0200)]
Merge pull request #99 from TheBlueMatt/main

Don't panic on tx broadcast failures

20 months agoDon't panic on tx broadcast failures
Matt Corallo [Thu, 23 Mar 2023 19:14:08 +0000 (19:14 +0000)]
Don't panic on tx broadcast failures

In general LDK will often broadcast transactions which aren't
actually able to get into the mempool. That's generally fine,
though could indicate a significant issue. Thus, we previously had
a panic in place for it to ensure developers are notified and we
can investigate.

However, now that people are trying to actually *use* ldk-sample,
we should just remove the panic and print something with more
details.

20 months agoPass a logger through into `BitcoindClient`
Matt Corallo [Fri, 24 Mar 2023 22:15:32 +0000 (22:15 +0000)]
Pass a logger through into `BitcoindClient`

20 months agoMerge pull request #97 from valentinewallace/2023-02-0.0.114
Matt Corallo [Tue, 7 Mar 2023 18:41:44 +0000 (18:41 +0000)]
Merge pull request #97 from valentinewallace/2023-02-0.0.114

Update to LDK version 0.0.114

20 months agoUpdate to LDK v0.0.114
Valentine Wallace [Tue, 7 Mar 2023 17:02:36 +0000 (12:02 -0500)]
Update to LDK v0.0.114

21 months agoMerge pull request #96 from TheBlueMatt/main
Elias Rohrer [Fri, 10 Feb 2023 14:22:23 +0000 (15:22 +0100)]
Merge pull request #96 from TheBlueMatt/main

Its 2023, its time to support v6

21 months agoIts 2023, its time to support v6
Matt Corallo [Wed, 8 Feb 2023 17:52:44 +0000 (17:52 +0000)]
Its 2023, its time to support v6

21 months agoMerge pull request #95 from freddiekrugerrand/01-22-startupargs
Elias Rohrer [Wed, 1 Feb 2023 21:50:41 +0000 (22:50 +0100)]
Merge pull request #95 from freddiekrugerrand/01-22-startupargs

Prompt user to provide at least 2 arguments rather than 3

21 months agoPrompt user to provide at least 2 arguments rather than 3
FreddieKrugerrand [Wed, 1 Feb 2023 20:23:00 +0000 (15:23 -0500)]
Prompt user to provide at least 2 arguments rather than 3

env::args returns the name of the binary, which isn't something
the end user would think about. So while we require at least 3
arguments, it makes sense to only ask for 2.

22 months agoMerge pull request #94 from TheBlueMatt/main
Elias Rohrer [Wed, 11 Jan 2023 19:15:53 +0000 (20:15 +0100)]
Merge pull request #94 from TheBlueMatt/main

Restore MSRV to 1.48

22 months agoRestore MSRV to 1.48
Matt Corallo [Wed, 11 Jan 2023 18:37:08 +0000 (18:37 +0000)]
Restore MSRV to 1.48

This reverts 810054ead2e022a771e902c26327313597947b96 and reverts
some `Cargo.lock` changes in fbb1f231ef0e1e8362d353e5d4e3aaecba42a

22 months agoMerge pull request #93 from tnull/2023-01-update-to-v0.0.113
Elias Rohrer [Wed, 11 Jan 2023 14:40:32 +0000 (15:40 +0100)]
Merge pull request #93 from tnull/2023-01-update-to-v0.0.113

Update to LDK release 0.0.113

22 months agoRaise MSRV to 1.49.0, following tokio
Elias Rohrer [Wed, 11 Jan 2023 11:45:13 +0000 (12:45 +0100)]
Raise MSRV to 1.49.0, following tokio

22 months agoUpdate for LDK release 0.0.113
Elias Rohrer [Wed, 11 Jan 2023 11:26:11 +0000 (12:26 +0100)]
Update for LDK release 0.0.113

22 months agoMerge pull request #89 from alecchendev/parse-env-followup
Matt Corallo [Thu, 5 Jan 2023 23:34:32 +0000 (23:34 +0000)]
Merge pull request #89 from alecchendev/parse-env-followup

Followup: Parse .cookie, .env, or environment variables for RPC auth details

22 months agoMerge pull request #85 from ch1ru/main
valentinewallace [Thu, 5 Jan 2023 17:14:43 +0000 (12:14 -0500)]
Merge pull request #85 from ch1ru/main

Add `disconnectpeer` subcommand

22 months agoChange order of where to find rpc auth
Alec Chen [Thu, 5 Jan 2023 01:41:41 +0000 (19:41 -0600)]
Change order of where to find rpc auth

22 months agoFix testnet datadir path
Alec Chen [Thu, 5 Jan 2023 01:36:13 +0000 (19:36 -0600)]
Fix testnet datadir path

22 months agoMerge pull request #87 from alecchendev/parse-env
Matt Corallo [Thu, 5 Jan 2023 00:49:06 +0000 (00:49 +0000)]
Merge pull request #87 from alecchendev/parse-env

Parse .cookie, .env, or environment variables for RPC auth details

22 months agoParse .cookie, .env, or environment variables for RPC auth details
Alec Chen [Tue, 20 Dec 2022 01:28:59 +0000 (19:28 -0600)]
Parse .cookie, .env, or environment variables for RPC auth details

2 years agoMerge pull request #78 from MaxFangX/fix-chanman-race-panic
Jeffrey Czyz [Wed, 2 Nov 2022 20:52:18 +0000 (15:52 -0500)]
Merge pull request #78 from MaxFangX/fix-chanman-race-panic

Fix channel manager race panic

2 years agoRemove `chain_tip`'s unneeded `Option`
Max Fang [Wed, 2 Nov 2022 20:15:50 +0000 (13:15 -0700)]
Remove `chain_tip`'s unneeded `Option`

2 years agoFix channel manager race panic
Max Fang [Tue, 18 Oct 2022 01:57:58 +0000 (18:57 -0700)]
Fix channel manager race panic

The race:
- (1) If a channel manager is starting for the first time, it gets its
  initial block hash by calling BlockSource::get_blockchain_info() and
  constructing a BestBlock out of that.
- (2) During the initial chain sync, if chain_tip.is_none() then the
  best chain_tip is retrieved using
  lightning_block_sync::init::validate_best_block_header() which
  similarly uses BlockSource::get_best_block()
- If blocks were mined between (1) and (2), the channel manager’s block
  hash will be at a lower height than that of the block hash contained
  inside the chain_tip fed to the SpvClient. Suppose that this results
  in the channel manager being at block 1 and the SpvClient being at
  block 2. Once block 3 comes in and the SpvClient detects it via
  poll_best_tip(), the SpvClient computes the ChainDifference between
  its saved chain_tip value and block 3, concluding that it just needs
  to connect block 3. However, when Listen::filtered_block_connected is
  called using the data in block 3, the channel manager panics with
  “Blocks must be connected in chain-order - the connected header must
  build on the last connected header” - because block 3’s prev block
  hash is block 2’s block hash, rather than block 1’s block hash which
  the channel manager expects

This commit fixes it by removing the fresh channel manager's query to
the block source, instead deriving its best block from the validated
block header using a new `.to_best_block()` method.

2 years agoMerge pull request #86 from MaxFangX/update-lock
Matt Corallo [Wed, 2 Nov 2022 19:40:04 +0000 (19:40 +0000)]
Merge pull request #86 from MaxFangX/update-lock

Update Cargo.lock to reflect new package name

2 years agoUpdate Cargo.lock to reflect new package name
Max Fang [Wed, 2 Nov 2022 18:46:08 +0000 (11:46 -0700)]
Update Cargo.lock to reflect new package name

2 years agoAdd `disconnectpeer` subcommand
Chiru [Tue, 1 Nov 2022 17:29:33 +0000 (17:29 +0000)]
Add `disconnectpeer` subcommand

Disconnect peer with `disconnectpeer <pubkey>`.
Checks all channels are closed before disconnecting.

2 years agoMerge pull request #82 from TheBlueMatt/main
valentinewallace [Tue, 1 Nov 2022 00:46:09 +0000 (20:46 -0400)]
Merge pull request #82 from TheBlueMatt/main

Update to LDK 0.0.112