niftynei
6dc954bb91
df-bugs: rm duplicate call to channeld
...
This gets called from channel_set_owner, which both `delete_channel` and
the `channel_fail_reconnect` pathways call.
Fixes crash
------------------------------------------------------ Captured stderr teardown -------------------------------------------------------
lightning_connectd: peer_disconnected unknown peer: 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518 (version v0.10.0-144-gfaf98c9)
0x560e90d59d08 send_backtrace
common/daemon.c:39
0x560e90d648a5 status_failed
common/status.c:214
0x560e90d50e8f peer_disconnected
connectd/connectd.c:1606
0x560e90d510d5 recv_req
connectd/connectd.c:1662
0x560e90d5a266 handle_read
common/daemon_conn.c:31
0x560e90d98ccb next_plan
ccan/ccan/io/io.c:59
0x560e90d998b0 do_plan
ccan/ccan/io/io.c:407
0x560e90d998f2 io_ready
ccan/ccan/io/io.c:417
0x560e90d9bb8a io_loop
ccan/ccan/io/poll.c:445
0x560e90d512c8 main
connectd/connectd.c:1735
0x7fbdb828b0b2 ???
???:0
0x560e90d4a6dd ???
???:0
0xffffffffffffffff ???
???:0
2021-05-11 15:37:24 +09:30
niftynei
a293bf3269
rbf_channel hook: add channel_max_msat parameter
...
Changelog-Added: Plugins: `rbf_channel` hook has `channel_max_msat` parameter
2021-05-03 11:06:10 +09:30
niftynei
5a04dc185c
openchannel2/rbf hooks: reject if response malformed
...
You gotta send over an amount if you send a psbt!
2021-05-03 11:06:10 +09:30
niftynei
7c76363e20
openchannel2: add channel_max_msat to openchannel2 hook payload
...
Changelog-Added: Plugins: add a `channel_max_msat` value to the `openchannel2` hook. Tells you the total max funding this channel is allowed to have.
2021-05-03 11:06:10 +09:30
niftynei
0ae2b0c33d
dual-funding: bugfix, swapped commitment/funding feerates
...
Found via a protocol test, huzzah. And also whoops.
2021-04-16 15:33:44 +09:30
niftynei
d5bf6bb994
dual-fund: on witness failure, route through dualopend
...
We want to notify the peer that we've failed and why, as a courtesy.
2021-04-16 15:33:44 +09:30
Rusty Russell
3ccb6d6e7a
Makefile: update to latest BOLT versions.
...
The main change which affects us is that 2016 blocks to forget a channel
is a fixed number in the spec; we make this clear by renaming the
(developer-only) max_funding_unconfirmed to dev_max_funding_unconfirmed
and making it compile DEVELOPER only.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-04-07 14:34:39 +09:30
niftynei
3e8f575f9e
dual-funding: convert to runtime flag, --experimental-dual-fund
...
You can now activate dual-funded channels using the
`--experimental-dual-fund` flag
Changelog-Changed: Config: `--experimental-dual-fund` runtime flag will enable dual-funded protocol on this node
2021-03-25 20:05:11 +10:30
niftynei
fc64ebdb53
dual-funding: don't not update the state! log the issue and move on with
...
with your life
2021-03-17 10:25:18 +10:30
niftynei
dd696a7c05
df: move from warning to unusual
...
There are perfectly valid reasons for us to not have a command on return
(something went boom while sending them our sigs and we've now gotten
their sigs during a reconnect and subsequently broadcast the tx)
2021-03-17 10:25:18 +10:30
niftynei
61df08c50d
df-broadcasts: use an impermanent marker to make sure we've sent things
...
This can result in us logging a warning if we've 1) dropped their sigs
response, 2) only us (the opener) added inputs, 3) and we broadcast on
their reconnect (when they retransmit their sigs)
2021-03-17 10:25:18 +10:30
niftynei
bec96a6c5b
df: add openchannel_abort command
...
Allows us to clean up an in-progress open that we won't be completing
Changelog-Added: EXPERIMENTAL JSON-RPC: Permit user-initiated aborting of in-progress opens. Only valid for not-yet-committed opens and RBF-attempts
2021-03-15 14:08:44 +10:30
niftynei
015a0555d0
df: nit, update to use proper helper json function for channel_id
2021-03-15 14:08:44 +10:30
niftynei
8182e9cea4
df: update the openchannel2 parameter 'accepter' -> 'our'
...
The `rbf_channel` hook uses `our_funding_msat`, which is a nicer
and more easily understood than the `openchannel2`
`accepter_funding_msat`.
This updates the `openchannel2` hook to use the same nomenclature as
`rbf_channel`.
2021-03-12 14:00:19 +10:30
niftynei
a60d652517
df: add missing check for already set scriptpubkey
...
Noticed while adding the documentation for the hook.
2021-03-12 14:00:19 +10:30
niftynei
52b5dbb01d
df: add doc for channel_open_failed
notification
...
When a channel fails, send out a notification.
We were missing this notification in one case, which has been added.
2021-03-12 14:00:19 +10:30
niftynei
fc9e72b62b
df-doc: add docs for openchannel_bump, more checks for valid psbt
...
Add docs for openchannel_bump, plus some checks that were missed for
verifying the amount is valid.
2021-03-12 14:00:19 +10:30
niftynei
a648ec827a
df-doc: update error codes, make sure they're correct
2021-03-12 14:00:19 +10:30
niftynei
26e4bae9ce
df: fail channel if peer sends witnesses that aren't paid for
...
The receiving node: ...
- MUST fail the channel if:
- the `witness_stack` weight lowers the effective `feerate`
below the agreed upon transaction `feerate`
2021-03-09 14:55:05 +10:30
niftynei
31e3bdb42d
df-spec: consolidate dual-funding patches, update feerate protocol
...
We consolidate to the latest/singular RFC patch for dual-funding, so
there's just a single patchfile for the change. Plus we move back to the
opener setting the desired feerate, the accepter merely declines to
participate if they disagree with the set rate.
2021-03-09 14:55:05 +10:30
niftynei
71164799f9
dual-fund: remove all references to PODLEs
...
We're punting on PODLE's for v1 of dual-funded channels
2021-03-09 14:55:05 +10:30
niftynei
8cc2919884
connectd: clean up the channel stuffs when we get a reconnect
...
If they've disconnected/reconnected we need to terminate all the
inflight stuff, plus go ahead and call 'disconnect' plugin trigger etc.
2021-03-06 15:03:56 +10:30
niftynei
97e64915c5
df: add (over zealous?) note about the usage of psbt_has_req_fields
...
Requested-In-Part-By: Rusty Russell @rustyrussell
2021-03-06 15:03:56 +10:30
niftynei
fc411a5925
df-memleak: expose memleak error and fix
...
We were getting a memleak error that the open_attempt isnt' being
cleaned up in test_rbf_reconnect_tx_construct. I had some trouble
reproducing it, so I removed the reliance on using `tmpctx` to clean it
up and was more surgical about cleaning it up inline.
2021-03-06 15:03:56 +10:30
niftynei
e0a2d47903
df-rbf: reconnection tests (init_rbf + ack_rbf)
2021-03-06 15:03:56 +10:30
niftynei
07153bff6a
df: cleanup error handling on lightningd side
...
Make existing methods understand how unsaved channels work, re-work
errors so that we handle everything appropriately
2021-03-06 15:03:56 +10:30
niftynei
6c76dd338e
channel: move inflight + feerate methods to channel.c
...
Need these more accessible for next patch, which moves the next_feerate
info into listpeers
2021-03-06 15:03:56 +10:30
niftynei
a23277af57
listpeers: include info on channels that are in-process
...
Channels that we're in negotiation for, but don't have a commitment
transaction saved for yet.
2021-03-06 15:03:56 +10:30
niftynei
ff069ff924
rbf: consolidate failure paths, use "warnings"
...
We move over to the new "warning" paradigm, instead of using
an "rbf_fail" message.
Every failure is either a warning or an error; on warnings we
hang up and reconnect later, effectively resetting the state.
2021-03-06 15:03:56 +10:30
niftynei
4fb95a9350
df-rbf: separate first-time channel save from update (RBF)
...
We can't "first save" a channel twice; instead we split in two and just
update the underlying channel on subsequent passes (RBFs)
2021-03-06 15:03:56 +10:30
niftynei
f22fed3fd5
df-rbf: only permit the channel initiator to init RBF
...
We're *mostly* set up for both sides doing RBF, except that it reverses
the callback flow (using the plugin vs RPC calls) and we're not
currently smart enough to flip between them gracefully
2021-03-06 15:03:56 +10:30
niftynei
a0cb7bd9b4
df: update reserve calculation
...
We can use the funding amount to derive the reserve requirement.
2021-03-06 15:03:56 +10:30
niftynei
2719ff8c3b
df-rbf: handle rbf failures in lightningd
2021-03-06 15:03:56 +10:30
niftynei
d47358848f
df-rbf: init an rbf for real, using openchannel_bumpfee
...
Reorg a bit of the RBF code so we use the same codepaths for we-init vs
they-init starts.
2021-03-06 15:03:56 +10:30
niftynei
063948d51a
df-feerates: send back original + last known feerates
...
For calculating the next RBF attempt's feerate, we need some historical
information about the feerate used for this channel
2021-03-03 16:19:04 -06:00
niftynei
cf170c3909
df: allow for RBF_INIT in sigs states
2021-03-03 16:19:04 -06:00
niftynei
02d99acca1
dualopen: check that peer is connected for json calls
...
Before we start trying to talk to the peer, check that they're
connected.
2021-03-03 16:19:04 -06:00
niftynei
d8221aae76
df: update channel_id when opening; closing; disconnecting
...
We were missing the channel_id for accepter opens; it's also a good idea
to reset it to 0xFF when we disconnect totally
2021-03-03 16:19:04 -06:00
niftynei
6407ad334f
df, channel: if a channel reconnects, but it's "unsaved" still
...
Go ahead and start dualopend, but as a fresh instance.
2021-03-03 16:19:04 -06:00
niftynei
779067d74c
df: check inflights when deciding whether or not to allow command
...
We were missing the inflight state checks before allowing to proceed
with a command.
2021-03-03 16:19:04 -06:00
niftynei
da81d4bced
channel: skip unsaved channels
...
Now that "peer->channels" contains `unsaved` channels, skip overthem
where appropriate
2021-03-03 16:19:04 -06:00
niftynei
de3599e98a
subd: remove ctype (channel_type)
...
We only needed the type check for dual_open, since it was the only
subdaemon path that used two 'types' in the subd->channel field.
2021-03-03 16:19:04 -06:00
niftynei
1e9a900918
df: start of RPC for bumping the fee!
...
Doesn't call into dualopend yet
2021-03-03 16:19:04 -06:00
niftynei
d49db8ad41
df: do the right thing, now that we have a cancellation routine
...
removes a fixme
2021-03-03 16:19:04 -06:00
niftynei
3da2ae4d30
df: move to inflights for sigs/openchannel_signed parts of flow
...
We create an inflight once we get the commitment tx for a channel
instead of once we get the funding transaction signatures
2021-03-03 16:19:04 -06:00
niftynei
8b0e88dfb3
df: move initialization over to unsaved channel
...
uncommitted_channel -> channel (but unsaved)
2021-03-03 16:19:04 -06:00
niftynei
0951e2c941
df: get rid of unnecessary struct commit_rcvd
2021-03-03 16:19:04 -06:00
niftynei
95e81ce82c
df: helper to find the last (most recent) inflight for a channel
2021-03-03 16:19:04 -06:00
niftynei
628f9df320
df: consolidate callbacks for opener/accepter, move to open_attempt
2021-03-03 16:19:04 -06:00
niftynei
bfb862564e
df: method for disconnecting an *unsaved* channel
...
Since we're moving over to "unsaved channels" instead of
"uncommitted_channel" struct, we need a new utility to disconnect this
channe
2021-03-03 16:19:04 -06:00