| 652 | } |
| 653 | |
| 654 | static 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 | |
| 683 | static void set_reserve(struct tx_state *tx_state, |
| 684 | struct amount_sat funding_total, |
no test coverage detected