| 580 | } |
| 581 | |
| 582 | static 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 | |
| 611 | static void set_reserve(struct tx_state *tx_state, |
| 612 | struct amount_sat funding_total, |
no test coverage detected