MCPcopy Create free account
hub / github.com/ElementsProject/lightning / validate_inputs

Function validate_inputs

openingd/dualopend.c:654–681  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

652}
653
654static char *validate_inputs(struct state *state,
655 struct tx_state *tx_state,
656 enum tx_role role_to_validate)
657{
658 /* BOLT #2:
659 * Upon receipt of consecutive `tx_complete`s, the receiving node:
660 * ...
661 * - if it has sent `require_confirmed_inputs` in `open_channel2`,
662 * `accept_channel2`, `tx_init_rbf` or `tx_ack_rbf`:
663 * - MUST fail the negotiation if:
664 * - one of the inputs added by the other peer is unconfirmed
665 */
666 u8 *msg;
667 char *err_reason;
668
669 msg = towire_dualopend_validate_inputs(NULL, tx_state->psbt,
670 role_to_validate);
671 wire_sync_write(REQ_FD, take(msg));
672 msg = wire_sync_read(tmpctx, REQ_FD);
673
674 if (!fromwire_dualopend_validate_inputs_reply(msg)) {
675 if (!fromwire_dualopend_fail(tmpctx, msg, &err_reason))
676 master_badmsg(fromwire_peektype(msg), msg);
677 return err_reason;
678 }
679
680 return NULL;
681}
682
683static void set_reserve(struct tx_state *tx_state,
684 struct amount_sat funding_total,

Callers 3

accepter_startFunction · 0.85
opener_startFunction · 0.85
rbf_wrap_upFunction · 0.85

Calls 4

fromwire_peektypeFunction · 0.85
wire_sync_writeFunction · 0.50
wire_sync_readFunction · 0.50
master_badmsgFunction · 0.50

Tested by

no test coverage detected