| 1768 | } |
| 1769 | |
| 1770 | void dualopen_tell_depth(struct subd *dualopend, |
| 1771 | struct channel *channel, |
| 1772 | const struct bitcoin_txid *txid, |
| 1773 | u32 depth) |
| 1774 | { |
| 1775 | const u8 *msg; |
| 1776 | u32 to_go; |
| 1777 | |
| 1778 | if (depth < channel->minimum_depth) { |
| 1779 | to_go = channel->minimum_depth - depth; |
| 1780 | } else |
| 1781 | to_go = 0; |
| 1782 | |
| 1783 | /* Are we there yet? */ |
| 1784 | if (to_go == 0) { |
| 1785 | assert(channel->scid); |
| 1786 | assert(bitcoin_txid_eq(&channel->funding.txid, txid)); |
| 1787 | |
| 1788 | channel_set_billboard(channel, false, |
| 1789 | tal_fmt(tmpctx, "Funding depth reached" |
| 1790 | " %d confirmations, alerting peer" |
| 1791 | " we're locked-in.", |
| 1792 | to_go)); |
| 1793 | |
| 1794 | msg = towire_dualopend_depth_reached(NULL, depth); |
| 1795 | subd_send_msg(dualopend, take(msg)); |
| 1796 | } else |
| 1797 | channel_set_billboard(channel, false, |
| 1798 | tal_fmt(tmpctx, "Funding needs %d more" |
| 1799 | " confirmations to be ready.", |
| 1800 | to_go)); |
| 1801 | } |
| 1802 | |
| 1803 | static void rbf_got_offer(struct subd *dualopend, const u8 *msg) |
| 1804 | { |
no test coverage detected