mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-22 08:34:20 +01:00
dual-fund: on witness failure, route through dualopend
We want to notify the peer that we've failed and why, as a courtesy.
This commit is contained in:
@@ -1456,15 +1456,21 @@ static void handle_peer_tx_sigs_sent(struct subd *dualopend,
|
||||
* transaction `feerate`
|
||||
*/
|
||||
if (!feerate_satisfied(inflight->funding_psbt,
|
||||
inflight->funding->feerate))
|
||||
channel_fail_permanent(channel,
|
||||
REASON_PROTOCOL,
|
||||
"Agreed feerate %dperkw not"
|
||||
" met with witnesses %s",
|
||||
inflight->funding->feerate)) {
|
||||
char *errmsg = tal_fmt(tmpctx,
|
||||
"Witnesses lower effective"
|
||||
" feerate below agreed upon rate"
|
||||
" of %dperkw. Failing channel."
|
||||
" Offending PSBT: %s",
|
||||
inflight->funding->feerate,
|
||||
type_to_string(tmpctx,
|
||||
struct wally_psbt,
|
||||
inflight->funding_psbt));
|
||||
struct wally_psbt,
|
||||
inflight->funding_psbt));
|
||||
|
||||
/* Notify the peer we're failing */
|
||||
subd_send_msg(dualopend,
|
||||
take(towire_dualopend_fail(NULL, errmsg)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1778,15 +1784,21 @@ static void handle_peer_tx_sigs_msg(struct subd *dualopend,
|
||||
* transaction `feerate`
|
||||
*/
|
||||
if (!feerate_satisfied(inflight->funding_psbt,
|
||||
inflight->funding->feerate))
|
||||
channel_fail_permanent(channel,
|
||||
REASON_PROTOCOL,
|
||||
"Agreed feerate %dperkw not"
|
||||
" met with witnesses %s",
|
||||
inflight->funding->feerate)) {
|
||||
char *errmsg = tal_fmt(tmpctx,
|
||||
"Witnesses lower effective"
|
||||
" feerate below agreed upon rate"
|
||||
" of %dperkw. Failing channel."
|
||||
" Offending PSBT: %s",
|
||||
inflight->funding->feerate,
|
||||
type_to_string(tmpctx,
|
||||
struct wally_psbt,
|
||||
inflight->funding_psbt));
|
||||
struct wally_psbt,
|
||||
inflight->funding_psbt));
|
||||
|
||||
/* Notify the peer we're failing */
|
||||
subd_send_msg(dualopend,
|
||||
take(towire_dualopend_fail(NULL, errmsg)));
|
||||
}
|
||||
}
|
||||
|
||||
/* Send notification with peer's signed PSBT */
|
||||
|
||||
Reference in New Issue
Block a user