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

Function validate_inputs

openingd/dualopend.c:582–609  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

580}
581
582static char *validate_inputs(struct state *state,
583 struct tx_state *tx_state,
584 enum tx_role role_to_validate)
585{
586 /* BOLT #2:
587 * Upon receipt of consecutive `tx_complete`s, the receiving node:
588 * ...
589 * - if it has sent `require_confirmed_inputs` in `open_channel2`,
590 * `accept_channel2`, `tx_init_rbf` or `tx_ack_rbf`:
591 * - MUST fail the negotiation if:
592 * - one of the inputs added by the other peer is unconfirmed
593 */
594 u8 *msg;
595 char *err_reason;
596
597 msg = towire_dualopend_validate_inputs(NULL, tx_state->psbt,
598 role_to_validate);
599 wire_sync_write(REQ_FD, take(msg));
600 msg = wire_sync_read(tmpctx, REQ_FD);
601
602 if (!fromwire_dualopend_validate_inputs_reply(msg)) {
603 if (!fromwire_dualopend_fail(tmpctx, msg, &err_reason))
604 master_badmsg(fromwire_peektype(msg), msg);
605 return err_reason;
606 }
607
608 return NULL;
609}
610
611static void set_reserve(struct tx_state *tx_state,
612 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