Commit Graph
100 Commits
Author SHA1 Message Date
yyforyongyu 4ee862e3be blockcache: fix heap escape in GetBlock
This commit fixes a heap escape found in `GetBlock`. This happens
because the `msgBlock` is a pointer returned from `getBlockImpl`, and
the whole `getBlockImpl` escapes to the heap because it's referenced in
two places,
- in the `Cache`, it's used as a reference type to create the new block.
- this pointer is also returned and now needs to stay on the heap.

The fix is simple, we now make a copy of the block and use the copy
instead, freeing `getBlockImpl` from the heap.
2024-01-23 17:08:57 +08:00
yyforyongyu 77e5deae9d gomod: update btcd version to fix mem leak 2024-01-23 17:08:54 +08:00
Yong ec5b824879 Merge pull request #8406 from ziggie1984/fix-channel-opening-issue
Fix case where Opening Channels get stuck forever.
2024-01-23 02:12:44 +08:00
yyforyongyu 6abfa0b1ee scripts: add gpg key for yyforyongyu [skip ci] 2024-01-19 01:23:30 +08:00
Yong 54329a338e Merge pull request #8387 from ziggie1984/buildroute-use-lnd-default
buildroute use lnd default
2024-01-18 18:53:46 +08:00
Yong 1bc1295fc0 Merge pull request #8350 from ziggie1984/rename-bumpclosefee
Minor improvements in the lncli api regarding channel closures.
2024-01-17 00:41:29 +08:00
Yong 26c466aa80 Merge pull request #8372 from mohamedawnallah/deep-copy-transactions-GetBlock
routing: deep copy any transaction we obtain from `GetBlock` call.
2024-01-15 20:13:00 +08:00
Yong 34af399a5b Merge pull request #8096 from ziggie1984/fix-dip-below-reserve
lnwallet: Introduce a fee buffer.
2024-01-09 01:52:04 +08:00
yyforyongyu 6de21b2a02 routerrpc: add verbose log and ignore context canceled error 2024-01-05 22:18:25 +08:00
yyforyongyu 58677569b5 routing+routerrpc: remove redudant error check
Since `SendPaymentAsync` now never returns an error, there's no need to
catch it and check it in `SendPaymentV2`.
2024-01-05 18:11:04 +08:00
Yong ab8fb2c9c3 Merge pull request #8308 from ziggie1984/new_min_cltv_default
zpay32: Change min_final_cltv_expiry_delta.
2024-01-02 17:19:52 +08:00
Yong 9f42459036 Merge pull request #8177 from yyforyongyu/payment-status
routerrpc: optionally return the new payment status
2023-11-30 17:15:23 +08:00
yyforyongyu 827d728cd5 gomod: update btcwallet version 2023-11-30 17:12:32 +08:00
Yong 80684eccbd Merge pull request #8222 from ellemouton/wtclientStartupPerf
wtclient+migration: start storing chan max height in channel details bucket
2023-11-28 15:38:27 +08:00
yyforyongyu 4845b7ade3 docs: add release notes for v0.17.3 2023-11-28 14:07:15 +08:00
yyforyongyu 1ee665d14c lnwallet: make sure loop var is properly referenced 2023-11-28 14:06:53 +08:00
yyforyongyu 81841b7dab lnwallet: add unit test for extractPayDescs 2023-11-28 14:06:53 +08:00
yyforyongyu 85f4b13632 multi: enhance logging around channel reestablishment 2023-11-28 14:06:53 +08:00
yyforyongyu 3934844cc6 docs: add release notes for v0.17.3 2023-11-28 03:19:37 +08:00
yyforyongyu 9cc57fa371 lntest: add verbose logging when node fails to shutdown 2023-11-25 07:25:18 +08:00
yyforyongyu ae09ab2a21 input: use lnutils.SyncMap to store musig2 sessions 2023-11-25 07:25:18 +08:00
Yong f005b248ce Merge pull request #8181 from ProofOfKeags/docs/comprehensive-lncli
docs/comprehensive lncli
2023-11-22 06:58:48 +08:00
Yong e8bdf01fef Merge pull request #8201 from yyforyongyu/flake-fix
itest: fix flake in `multi_hop_htlc_remote_chain_claim`
2023-11-18 00:44:02 +08:00
Yong 3ee33ba561 Merge pull request #8173 from morehouse/simplify_tlv
tlv: simplify encoding functions
2023-11-17 20:37:15 +08:00
yyforyongyu ded9fe6a84 itest: fix flake in multi_hop_htlc_remote_chain_claim 2023-11-17 17:29:53 +08:00
yyforyongyu 99354313d5 routerrpc+itest: make sure TrackPayments is compatible
This commit adds an itest case to make sure when the flag
`routerrpc.usestatusinitiated` is not set, the new status is not sent.
2023-11-15 20:18:21 +08:00
yyforyongyu 9acbbf0ec7 routing: make sure StatusInitiated is notified when creating payments
This commit fixes `InitPayment` method to make sure the subscribers get
notified when new payments are created.
2023-11-15 20:18:21 +08:00
yyforyongyu 9e00799188 docs: update release notes 2023-11-15 20:18:21 +08:00
yyforyongyu 816a70e08c multi: add new config usestatusinitiated for the new payment status
This commit adds a new config value to signal that the user understands
the new payment status `StatusInitiated`.
2023-11-15 20:18:17 +08:00
yyforyongyu c58454effe routerrpc: modify field orders based on their assigned number
This commit is a pure refactoring which sorts the fields in
`SendPaymentRequest` so it's easier to see what number to use when
adding a new field.
2023-11-14 20:26:13 +08:00
yyforyongyu 922130c80e routerrpc: skip initiated payment in trackPaymentStream 2023-11-14 17:46:20 +08:00
yyforyongyu 5168af55a9 itest: fix flake in max_htlc_pathfind
```
lnd_max_htlcs_test.go:149:
        	Error Trace:	/home/runner/work/lnd/lnd/itest/lnd_max_htlcs_test.go:149
        	            				/home/runner/work/lnd/lnd/itest/lnd_max_htlcs_test.go:40
        	            				/home/runner/work/lnd/lnd/lntest/harness.go:286
        	            				/home/runner/work/lnd/lnd/itest/lnd_test.go:136
        	Error:      	Not equal:
        	            	expected: 3
        	            	actual  : 0
        	Test:       	TestLightningNetworkDaemon/tranche01/60-of-134/btcd/max_htlc_pathfind
        	Messages:   	expected accepted
```
2023-11-13 16:11:07 +08:00
yyforyongyu 678f416008 routing+docs: make sure non-MPP cannot use skipTempErr 2023-11-13 16:11:06 +08:00
yyforyongyu 168cfd7cd5 docs: emphasize the new payment status StatusInitiated 2023-11-13 16:10:51 +08:00
yyforyongyu 98378d9408 routing: unify all dummy errors to be errDummy 2023-11-13 16:10:28 +08:00
yyforyongyu 7ccb77269d routing: log preimage when it's failed to be saved to db 2023-11-13 16:10:28 +08:00
yyforyongyu 8f5c6e8367 trivial: fix typos 2023-11-13 16:10:28 +08:00
yyforyongyu e3dadd528b routing: mark payment as failed when no route can be found 2023-11-13 16:10:28 +08:00
yyforyongyu 27ee917a20 docs: update release note for payment lifecycle 2023-11-13 16:10:26 +08:00
yyforyongyu 6e93764bc1 routing: make sure payment hash is random in unit tests
This commit makes sure a testing payment is created via
`createDummyLightningPayment` to ensure the payment hash is unique to
avoid collision of the same payment hash being used in uint tests. Since
the tests are running in parallel and accessing db, if two difference
tests are using the same payment hash, no clean test state can be
guaranteed.
2023-11-13 16:09:12 +08:00
yyforyongyu 10052ff4f5 routing: patch unit tests for payment lifecycle
This commit adds unit tests for `resumePayment`. In addition, the
`resumePayment` has been split into two parts so it's easier to be
tested, 1) sending the htlc, and 2) collecting results. As seen in the
new tests, this split largely reduces the complexity involved and makes
the unit test flow sequential.

This commit also makes full use of `mock.Mock` in the unit tests to
provide a more clear testing flow.
2023-11-13 16:09:12 +08:00
yyforyongyu e46c689bf1 routing: refactor attempt makers to return pointers
Thus adding following unit tests can be a bit easier.
2023-11-13 16:09:12 +08:00
yyforyongyu ddad6ad4c4 routing: update mockers in unit test
This commit adds more mockers to be used in coming unit tests and
simplified the mockers to be more straightforward.
2023-11-13 16:09:12 +08:00
yyforyongyu 01e3bd87ab routing: delete old payment lifecycle related unit tests
The old payment lifecycle is removed due to it's not "unit" -
maintaining these tests probably takes as much work as the actual
methods being tested, if not more so. Moreover, the usage of the old
mockers in current payment lifecycle test is removed as it re-implements
other interfaces and sometimes implements it uniquely just for the
tests. This is bad as, not only we need to work on the actual interface
implementations and test them , but also re-implement them again in the
test without testing them!
2023-11-13 16:09:11 +08:00
yyforyongyu 09a5d235ec routing: fail attempt when no shard is found or circuit generation fails 2023-11-13 16:09:11 +08:00
yyforyongyu eda24ec871 routing: catch lifecycle quit signal in collectResult 2023-11-13 16:09:11 +08:00
yyforyongyu da8f1c084a channeldb+routing: add new interface method TerminalInfo
This commit adds a new interface method `TerminalInfo` and changes its
implementation to return an `*HTLCAttempt` so it includes the route for
a successful payment. Method `GetFailureReason` is now removed as its
returned value can be found in the above method.
2023-11-13 16:09:11 +08:00
yyforyongyu 3c5c37b693 routing: introduce stateStep to manage payment lifecycle
This commit adds a new struct, `stateStep`, to decide the workflow
inside `resumePayment`.

It also refactors `collectResultAsync` introducing a new channel
`resultCollected`. This channel is used to signal the payment
lifecycle that an HTLC attempt result is ready to be processed.
2023-11-13 16:09:11 +08:00
yyforyongyu e8c0226e1c routing: add AllowMoreAttempts to decide whether more attempts are allowed 2023-11-13 16:09:11 +08:00
yyforyongyu 173900c8dc routing: only fail attempt inside handleSwitchErr
This commit makes sure we only fail attempt inside `handleSwitchErr` to
ensure the orders in failing payment and attempts. It refactors
`collectResult` to return `attemptResult`, and expands `handleSwitchErr`
to also handle the case where the attemptID is not found.
2023-11-13 16:09:10 +08:00
yyforyongyu 703ea08316 routing: add methods checkTimeout and requestRoute
This commit refactors the `resumePayment` method by adding the methods
`checkTimeout` and `requestRoute` so it's easier to understand the flow
and reason about the error handling.
2023-11-13 16:09:10 +08:00
yyforyongyu 7209c65ccf routing: split launchShard into registerAttempt and sendAttempt
This commit removes the method `launchShard` and splits its original
functionality into two steps - first create the attempt, second send the
attempt. This enables us to have finer control over "which error is
returned from which system and how to handle it".
2023-11-13 16:09:10 +08:00
yyforyongyu 49bafc0207 routing: handle switch error when sendAttempt fails
This commit starts handling switch error inside `sendAttempt` when an
error is returned from sending the HTLC. To make sure the updated
`HTLCAttempt` is always returned to the callsite, `handleSwitchErr` now
also returns a `attemptResult`.
2023-11-13 16:09:10 +08:00
yyforyongyu 568b977a1f routing: add new method registerAttempt
This commit adds a new method `registerAttempt` to take care of creating
and saving an htlc attempt to disk.
2023-11-13 16:09:10 +08:00
yyforyongyu 071d05e0e3 routing: unify shardResult and launchOutcome to be attemptResult
This commit removes the `launchOutcome` and `shardResult` and uses
`attemptResult` instead. This struct is also used in `failAttempt` so we
can future distinguish critical vs non-critical errors when handling
HTLC attempts.
2023-11-13 16:09:10 +08:00
yyforyongyu 4bb8db46df routing: fail payment before attempt inside handleSwitchErr
`handleSwitchErr` is now responsible for failing the given HTLC attempt
after deciding to fail the payment or not. This is crucial as
previously, we might enter into a state where the payment's HTLC has
already been marked as failed, and while we are marking the payment as
failed, another HTLC attempt can be made at the same time, leading to
potential stuck payments.
2023-11-13 16:09:09 +08:00
yyforyongyu 8458966f02 routing: remove the abstraction shardHandler
This commit removes the unclear abstraction `shardHandler` that's used
in our payment lifecycle. As we'll see in the following commits,
`shardHandler` is an unnecessary layer and everything can be cleanly
managed inside `paymentLifecycle`.
2023-11-13 16:09:09 +08:00
yyforyongyu 994a1426d6 CI: upgrade bitcoind version to 0.25 2023-11-01 16:34:07 +08:00
yyforyongyu fc52a01055 itest: fix test flake in testHtlcTimeoutResolverExtractPreimageRemote
From the build,
```
harness_miner.go:218:
        	Error Trace:	/home/runner/work/lnd/lnd/lntest/harness_miner.go:218
        	            				/home/runner/work/lnd/lnd/lntest/harness.go:1641
        	            				/home/runner/work/lnd/lnd/itest/lnd_multi-hop_test.go:2207
        	            				/home/runner/work/lnd/lnd/itest/lnd_multi-hop_test.go:152
        	Error:      	Received unexpected error:
        	            	want 2, got 3 in mempool: [a7cbb5724e39579cfc75d0469270f691988cb67fcc51a332256cafb193cf40bd b12a03a0622a3cf7d53867f060a6de8166e564a1a3109bc2be1ec0b720f305da 073d66885ccded1a770dc9aa5f1d44c8e10ac4e916e5ab50ef5149a5649ec8ba]
        	Test:       	TestLightningNetworkDaemon/tranche03/130-of-135/neutrino/htlc_timeout_resolver_extract_preimage_remote/zeroconf=false/committype=SIMPLE_TAPROOT
        	Messages:   	assert tx in mempool timeout
    harness.go:339: finished test: htlc_timeout_resolver_extract_preimage_remote, start height=1312, end height=1347, mined blocks=35
```
2023-10-31 23:49:31 +08:00
yyforyongyu cc6b20bf2f lntest: mine empty blocks when cleaning up force close
Fix this test flake,
```
harness_miner.go:218:
        	Error Trace:	/home/runner/work/lnd/lnd/lntest/harness_miner.go:218
        	            				/home/runner/work/lnd/lnd/lntest/harness.go:1641
        	            				/home/runner/work/lnd/lnd/lntest/harness.go:1515
        	            				/home/runner/work/lnd/lnd/itest/lnd_wipe_fwdpkgs_test.go:121
        	            				/home/runner/work/lnd/lnd/lntest/harness.go:286
        	            				/home/runner/work/lnd/lnd/itest/lnd_test.go:136
        	Error:      	Received unexpected error:
        	            	want 1, got 0 in mempool: []
        	Test:       	TestLightningNetworkDaemon/tranche02/91-of-135/neutrino/wipe_forwarding_packages
        	Messages:   	assert tx in mempool timeout
    harness.go:339: finished test: wipe_forwarding_packages, start height=1636, end height=1653, mined blocks=17
    harness.go:345: test failed, skipped cleanup
```
2023-10-31 16:51:24 +08:00
yyforyongyu 2caa7d2b2b invoices: add verbose errors to catch flakes in
`TestInvoiceExpiryWithRegistry`
2023-10-31 16:31:44 +08:00
yyforyongyu 28497e940f docs: update release notes re empty witness data 2023-10-31 01:45:07 +08:00
yyforyongyu ee883c332f chainntnfs: stop lnd when received witness stack is empty
This commit uses `Criticalf` to gracefully stop `lnd` when the received
witness data is empty.
2023-10-31 01:44:43 +08:00
yyforyongyu 28c3c835bf chainntnfs: return an error when witness stack is empty
This commit adds a check when receiving transactions from
`BitcoindClient` so an error is returned when empty witness is found.
2023-10-31 01:44:43 +08:00
yyforyongyu 971d3d8d9c contractcourt: make sure isPreimageSpend won't panic
This commit adds a length check in `isPreimageSpend` to make sure it
won't ever panic and adds a unit test to verify it.
2023-10-31 01:44:43 +08:00
yyforyongyu 3c62ba57d3 chainfee: make timeout values constant 2023-10-29 13:24:28 +08:00
yyforyongyu 090892c613 chainfee: use proper mock for WebAPIFeeSource in tests 2023-10-29 13:24:27 +08:00
yyforyongyu efcba4a836 chainfee: simplify WebAPIFeeSource interface
This commit removes the interface methods `GenQueryURL` and
`ParseResponse` so the `WebAPIEstimator` can care less about the
implementation details of this interface.
2023-10-29 13:24:27 +08:00
yyforyongyu 8ca48311ee chainfee: add a new interface method GetFeeMap
This commit adds a new method `GetFeeMap` to handle querying the web API
and parse the response into a map that's used by the fee estimator. In
doing so we can provide a deeper abstraction over the `WebAPIFeeSource`
interface.
2023-10-29 13:24:27 +08:00
yyforyongyu dba4c8e5ad trivial: fix typo and nits 2023-10-23 13:01:52 +08:00
yyforyongyu 05fbe8b116 docs: update release note re RBF fix 2023-10-23 13:01:52 +08:00
yyforyongyu 0816f9124c itest: update itest to reflect new sweeper behavior 2023-10-23 13:01:50 +08:00
yyforyongyu 92837621ec sweep: remove possible RBF when creating sweeping tx for new inputs
This commit changes how we create the input sets which are used to
construct the sweeping transactions. Assume the sweeper has two inputs,
one is new and one is retried, we'd end up having two transactions,
- tx1: which spends both the new and old inputs.
- tx2: which spends the new inputs only.
When publishing these txes, depending on which one gets into the mempool
first, the other one will be viewed as an RBF for the first one since
they both spending the same input(the new input).

This is now fixed by only attempt to publish the second tx when there
isn't a first tx - when there is a tx1, it means the new inputs are
already used in this tx along with retried inputs, hence there's no need
to publish tx2 which spends the new inputs only.
2023-10-23 10:48:51 +08:00
yyforyongyu acc15d8113 sweep: add new method rescheduleInputs and refactor sweep 2023-10-23 10:44:46 +08:00
yyforyongyu 7de4186766 sweep: simplify polling logic in sweeper
This commit attempts to make the polling logic in sweeper more linear.
Previously, the sweep's timer is reset/restarted in multiple places,
such as when a new input comes in, or a new block comes in, or a
previous input being spent, making it difficult to follow. We now remove
the old timer and replaces it with a simple polling logic - we will
schedule sweeps every 5s(default), and if there's no input to be swept,
we'd skip, just like the previous `scheduleSweep` does.
It's also worthy noting that, although `scheduleSweep` triggers the
timer to tick, by the time we do the actual sweep in `sweepCluster`,
conditions may have changed. This is now also fixed because we only have
one place to create the clusters and sweeps.
2023-10-23 10:24:58 +08:00
yyforyongyu 4ba09098d1 sweep+lnd: move ticker creation into sweeper 2023-10-23 10:24:58 +08:00
yyforyongyu 62b5869f87 sweep: add new method handleSweep 2023-10-23 10:24:58 +08:00
yyforyongyu f1d0f9f74e sweep: add new method handleInputSpent 2023-10-23 10:24:58 +08:00
yyforyongyu 39a7cc6434 sweep: rename waitForSpend to monitorSpend to avoid confusion
The method `waitForSpend` makes it sounding like it's blocking while
it's not, thus it's renamed to avoid confusion.
2023-10-23 10:24:58 +08:00
yyforyongyu 39973687aa sweep: add new method handleNewInput 2023-10-23 10:24:58 +08:00
yyforyongyu 59a20fe1d1 gomod: update btcwallet re rescan race fix 2023-10-18 01:31:27 +08:00
Yong 6a80530fff gomod: update btcwallet version (#8019) 2023-10-16 09:14:56 +02:00
yyforyongyu d0edb47166 docs: update release notes 2023-10-13 17:00:53 +08:00
yyforyongyu 551102a0f3 sweep: fix make lint 2023-10-13 17:00:53 +08:00
yyforyongyu 34e0c7b5e0 input+sweep: make sure input with no fee rate is not added to cluster
This commit makes sure an input is only added to the cluster when it has
successfully estimated its fee rate. Previously, when an error is
returned from `feeRateForPreference`, we'd still add this input to the
cluster, resulting a **lower** fee rates being used because when
averaging the fee rates, we'd think this input has zero fee rate
specified.

An unit test is patched to make the method `clusterByLockTime` more
robust.
2023-10-13 17:00:53 +08:00
yyforyongyu 0532b82dd5 multi: add new method FeePerVByte to avoid manual conversion 2023-10-13 17:00:53 +08:00
yyforyongyu a46168e669 sweep: remove redundant map inputFeeRates when creating cluster
This commit removes the map `inputFeeRates` inside `clusterByLockTime`
as the fee rate can already be access via `input.lastFeeRate`.
2023-10-13 17:00:53 +08:00
yyforyongyu 497f421009 sweep: patch unit test for feeRateForPreference 2023-10-13 17:00:53 +08:00
yyforyongyu 82053970ef lnd+sweep: move DetermineFeePerKw into config
This commit makes `DetermineFeePerKw` configurable on sweeper so it's
easier to write unit tests for it.
2023-10-13 14:44:20 +08:00
yyforyongyu 22600b47f1 multi: disable linter paralleltest 2023-10-13 13:50:09 +08:00
yyforyongyu 839b6271e5 peer: fix unit test flake 2023-10-13 13:50:07 +08:00
Yong 939375f1a5 sweeper: relax anchor sweeping when there's no deadline pressure (#7965)
* sweep: use longer variable name for clarity in `addToState`

* sweeper: add more docs and debug logs

* sweep: prioritize smaller inputs when adding wallet UTXOs

This commit sorts wallet UTXOs by their values when using them for
sweeping inputs. This way we'd avoid locking large UTXOs when sweeping
inputs and also provide an opportunity to aggregate wallet UTXOs.

* contractcourt+itest: relax anchor sweeping for CPFP purpose

This commit changes from always sweeping anchor for a local force close
to only do so when there is an actual time pressure. After this change,
a forced anchor sweeping will only be attempted when the deadline is
less than 144 blocks.

* docs: update release notes

* itest: update test `testMultiHopHtlcLocalChainClaim` to skip CPFP

Since we now only perform CPFP when both the fee rate is higher and the
deadline is less than 144, we need to update the test to reflect that
Bob will not CPFP the force close tx for the channle Alice->Bob.

* itest: fix `testMultiHopRemoteForceCloseOnChainHtlcTimeout`

* itest: update related tests to reflect anchor sweeping

This commit updates all related tests to reflect the latest anchor
sweeping behavior. Previously, anchor sweeping is always attempted as
CPFP when a force close is broadcast, while now it only happens when the
deadline is less than 144. For non-CPFP purpose sweeping, it will happen
after one block is mined after the force close transaction is confirmed
as the anchor will be resent to the sweeper with a floor fee rate, hence
making it economical to sweep.
2023-10-12 17:18:59 +02:00
Yong ca9cdacd5f github: print debug logs for failed unit tests (#8083) 2023-10-12 12:50:11 +02:00
Yong ec2377db79 funding: remove dead code and sanity check pending chan ID (#7887)
* funding: remove unused field `newChanBarriers`

This commit removes the occurance of `newChanBarriers` as it's not used
anywhere.

* funding: rename method names to clear the funding flow

Slightly refactored the names so it's easier to see which side is
processing what messages.

* lnwallet: sanity check empty pending channel ID

This commit adds a sanity check to make sure an empty pending channel ID
will not be accepted.
2023-10-09 10:58:18 +02:00
yyforyongyu 20e7e801c0 routing+channeldb: use HTLCAttempt instead of HTLCAttemptInfo
This commit refactors the params used in lifecycle to prefer
`HTLCAttempt` over `HTLCAttemptInfo`. This change is needed as
`HTLCAttempt` also wraps settled and failure info, which is useful in
the following commits.
2023-10-06 16:38:33 -07:00
yyforyongyu a6be939bfa routing: add newPaymentLifecycle to properly init lifecycle
This commit adds a new method to properly init a payment lifecycle so we
can easily see the default values used here.
2023-10-06 16:38:33 -07:00
yyforyongyu 34d0e5d4c5 routing+channeldb: make MPPayment into an interface
This commit turns `MPPayment` into an interface inside `routing`. Having
this interface gives us the benefit to write more granular unit tests
inside payment lifecycle. As seen from the modified unit tests, several
hacky ways of testing the `SendPayment` method is now replaced by a mock
over `MPPayment`.
2023-10-06 16:38:33 -07:00
yyforyongyu c412ab5ccb routing: add exitWithErr to handle error logging 2023-10-06 16:38:33 -07:00
yyforyongyu e5840f6216 channeldb+routing: add NeedWaitAttempts to decide waiting for attempts
This commit adds a new method, `NeedWaitAttempts`, to properly decide
whether we need to wait for the outcome of htlc attempts based on the
payment's current state.
2023-10-06 16:38:33 -07:00
yyforyongyu 89ac071e56 channeldb: add HasSettledHTLC and PaymentFailed fields to state 2023-10-06 16:38:33 -07:00