Commit Graph

13213 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
ab91f85d05 Merge pull request #6563 from yyforyongyu/export-chanstatus
multi: export channel status field in migration25
2022-05-23 11:26:53 -07:00
yyforyongyu
36b646496a docs: update release note for migrations fix 2022-05-23 05:36:14 +08:00
yyforyongyu
d7bb7cd9a7 migration27: add unit test to cover ChanStatusRestored 2022-05-23 05:13:56 +08:00
yyforyongyu
7cf28773bf multi: export channel status field in migration25
Previously, in `migration25.OpenChannel`, there was a private field
`chanStatus` used to keep track of the channel status. The following
migrations, `migration26` and `migration27` also have their own
`OpenChannel` defined, with `migration26` inherited from `migration25`,
and `migration27` inherited from `migration26`. The private field
`chanStatus`, however, is NOT inherited and each of the migrations uses
its own. This is fine for reading and writing as, under the hood, the
`chanStatus` is just a `uint8` value. Because each migration has its own
fetcher and putter, it can safely access its private field to read and
write it correctly.

The issue pops up when we use the method
`migration25.FundingTxPresent()`. Because it's evaluating its channel
status using its own private field `chanStatus`, this field would always
be the default value(`ChanStatusDefault`), leading the statement
`!c.hasChanStatus(ChanStatusRestored)` to always be true. Thus a
restored channel will be mistakenly considered to have funding tx
present, causing failures in reading the channel info in the following
migrations.

We fix this by exporting the `ChanStatus` field so its value can be set
by following migrations.
2022-05-23 03:55:00 +08:00
Olaoluwa Osuntokun
164a9c6f68 build: bump version to v0.15.0-beta.rc2 v0.15.0-beta.rc2 2022-05-20 00:08:28 -07:00
Olaoluwa Osuntokun
3e5b5d52f0 Merge pull request #6551 from yyforyongyu/fix-migration
channeldb: change balance fields to tlv records and migrate historical bucket
2022-05-19 16:35:31 -07:00
yyforyongyu
dae8e430d3 docs: update release note re patched fields 2022-05-20 06:55:34 +08:00
yyforyongyu
3458b2eb7d channeldb+migration27: patch balance fields for historical chan
This commit adds a new migration to patch the two balance fields,
`InitialLocalBalance` and `InitialRemoteBalance` for the historical
channels. Because they are not saved previously, for historical channels
prior to the revocation log PR, these fields will be empty.
2022-05-20 06:55:31 +08:00
yyforyongyu
55746e427e channeldb+migration26: migrate balance fields into tlv records 2022-05-19 03:34:24 +08:00
yyforyongyu
de2bcbf925 migration25: export methods to be used for following migrations
This commit exports several private methods to be used in later
migrations. It's safe to do so as no actual logic or migration scheme is
changed.
2022-05-19 03:34:13 +08:00
yyforyongyu
2ec459df6c channeldb: use TLV for InitialLocalBalance and InitialRemoteBalance
This commit changes the encoding scheme for the fields
`InitialLocalBalance` and `InitialRemoteBalance` and use TLV instead.
2022-05-18 19:46:09 +08:00
Oliver Gugger
e319fb888e Merge pull request #6547 from Crypt-iQ/boltfix_05-22
channeldb: copy value from boltdb's Get instead of using it directly
2022-05-17 19:43:03 +02:00
eugene
759d74ee15 release-notes: update for 0.15.0 2022-05-17 11:27:11 -04:00
eugene
2e3246aafe channeldb: copy value from boltdb's Get instead of using it directly
This can cause an intermittent panic otherwise if bbolt remaps itself
via munmap and mmap. From bbolt's documentation:

* Byte slices returned from Bolt are only valid during a transaction.
Once the transaction has been committed or rolled back then the memory
they point to can be reused by a new page or can be unmapped from
virtual memory and you'll see an unexpected fault address panic when
accessing it.
2022-05-17 11:14:40 -04:00
Olaoluwa Osuntokun
b31640e6b0 build: bump version to v0.15.0-beta.rc1 v0.15.0-beta.rc1 2022-05-16 20:16:01 -07:00
Oliver Gugger
04fb034259 Merge pull request #6535 from ErikEk/config-rpccookie-path
config: fix path to bitcoind/litecoind rpccookie and config
2022-05-16 16:06:04 +02:00
Oliver Gugger
6b57e92a37 Merge pull request #6529 from guggero/constrainmacaroon
lncli: add constrainmacaroon command
2022-05-16 15:57:52 +02:00
ErikEk
b6f56d3398 config: fix path to bitcoind.rpccookie and bitcoind.config 2022-05-16 13:55:16 +02:00
Oliver Gugger
4b313a54f8 Merge pull request #6536 from ErikEk/cookie-missing-error-msg-fix
config: error msg for missing bitcoind cookie file
2022-05-16 13:49:04 +02:00
Oliver Gugger
c647d32cf7 Merge pull request #6540 from yyforyongyu/6537-fix-push-amount
rpcserver: fix wrong unit used in PushAmountSat
2022-05-16 13:48:02 +02:00
ErikEk
fbf00f6e26 config: cookie missing error fix 2022-05-16 10:48:53 +02:00
yyforyongyu
6b34ebbe44 rpcserver: fix wrong unit used in PushAmountSat 2022-05-16 05:49:05 +08:00
Olaoluwa Osuntokun
2c4136da1b Merge pull request #6525 from Crypt-iQ/amp_preimage_fix
invoices: properly set Preimage field for success resolution
2022-05-13 15:15:03 -07:00
Oliver Gugger
8f94aac00a docs: add release notes 2022-05-13 13:41:10 +02:00
Oliver Gugger
968393975b cmd/lncli: add constrainmacaroon command 2022-05-13 13:41:10 +02:00
Oliver Gugger
f4e1f60e4d cmd/lncli: extract macaroon caveat flags
As a preparation for re-using the macaroon caveat/constraints CLI flags,
we extract the parsing and adding of those constraints into its own
function.
2022-05-13 13:38:53 +02:00
Olaoluwa Osuntokun
7106ea59db Merge pull request #6524 from guggero/aezeed-bump
aezeed+keychain: bump internal version of seed to 1
2022-05-12 16:35:49 -07:00
Olaoluwa Osuntokun
9f101f46ec Merge pull request #6528 from guggero/list-leased-outputs
btcwallet bump: add Taproot fields to FundPsbt, add pkScript and value to ListLeases
2022-05-12 16:24:00 -07:00
Oliver Gugger
5e411ac5f3 docs: add release notes 2022-05-12 12:49:15 +02:00
Oliver Gugger
51a480129b walletunlocker+keychain+config_builder: use new aezeed version 2022-05-12 12:49:14 +02:00
Oliver Gugger
daa5966119 aezeed: make seed generation fully deterministic
This commit fixes a TODO to make the seed generation fully deterministic
by providing the option to pass in a custom randomness source.
2022-05-12 12:49:14 +02:00
Oliver Gugger
63e28a27b8 aezeed: re-encode salt correctly 2022-05-12 12:49:14 +02:00
Oliver Gugger
f67776375f aezeed: re-format test cases, use require 2022-05-12 12:49:13 +02:00
Oliver Gugger
a02112464a aezeed: remove unnecessary casts 2022-05-12 12:47:07 +02:00
Oliver Gugger
83f1c2c9b6 aezeed: fix typos and formatting 2022-05-12 12:47:06 +02:00
Oliver Gugger
5240fa9983 docs: add release notes 2022-05-12 10:28:14 +02:00
Oliver Gugger
cb3cb4c8ab cmd/lncli: add pk script and value to JSON 2022-05-12 10:24:42 +02:00
Oliver Gugger
70103a1838 multi: return more information in list of leased outputs
With this commit we return the additional information the wallet now
provides about locked/leased outputs.
2022-05-12 10:24:40 +02:00
Oliver Gugger
a25d5255fb walletrpc: add pkScript and value to UTXO lease 2022-05-12 10:24:39 +02:00
Oliver Gugger
d716b721be mod: bump to latest btcwallet dependency
This commit bumps the btcwallet version to the latest master branch that
contains the fixes to add Taproot related fields to a PSBT in the
FundPsbt method.
2022-05-12 10:24:38 +02:00
Olaoluwa Osuntokun
4949243d67 Merge pull request #6477 from Crypt-iQ/testmultihopflake
invoices: add client to map before delivering backlog notif
2022-05-11 16:45:36 -07:00
Olaoluwa Osuntokun
7e5b353498 Merge pull request #6415 from Crypt-iQ/inv_refactor
channeldb+invoices: refactor invoice logic when updating
2022-05-11 16:45:10 -07:00
eugene
fdfc5041a3 release-notes: update for 0.15 2022-05-11 13:58:11 -04:00
Oliver Gugger
8086ff447e Merge pull request #6464 from kaloudis/mobile-build-subservers
Mobile builds: expose main sub-servers by default
2022-05-11 19:57:49 +02:00
eugene
4eea395a7f channeldb+invoices: refactor invoice logic when updating 2022-05-11 13:57:46 -04:00
eugene
3a5d2804bb release-notes: update for 0.15.0 2022-05-11 13:55:11 -04:00
eugene
d099991339 invoices: remove unused invoiceSubscriptionKit wait group 2022-05-11 13:54:45 -04:00
eugene
5ddad90a17 invoices: fix OOO notifications, use cancelChan instead of canceled
This commit fixes OOO notifications between backlog and non-backlog
events by having the non-backlog goroutines wait on a chan that
signals that backlog processing is complete.

This commit also replaces usage of the canceled atomic variable with
the cancelChan to signal that delivery of an event should no longer
occur. Atomics do not make perfect "sequence" points as the atomic
may be checked too early and the end-result of delivering to a stopped
ntfnQueue is the same. Using the cancelChan ensures that we do not
hang on sending to ntfnQueue.
2022-05-11 13:54:45 -04:00
eugene
93f87acb59 invoices: add client to map before delivering backlog notif
Prior to this change, if SubscribeSingleInvoice or
SubscribeNotifications was called, it was possible that a state
change would never be delivered to the client. The sequence of
events would be:
- delivery of backlog events with invoice in the Open state
- invoice goes to the Accepted state, no client to notify
- client added to map

This is fixed by adding the client to the map first. However, with
this change alone it then becomes possible for notifications to be
delivered out of order. This is addressed in a following commit.
2022-05-11 13:54:43 -04:00
eugene
d76278bc1e invoices: properly set Preimage for settle resolutions
This fixes a nil-pointer-dereference that would occur if this was
called for a settled AMP invoice. Terms.PaymentPreimage is always
false for AMP invoices.
2022-05-11 13:51:12 -04:00