| 557 | } |
| 558 | |
| 559 | static bool refresh_anchor_spend(struct channel *channel, |
| 560 | const struct bitcoin_tx **tx, |
| 561 | struct one_anchor *anch) |
| 562 | { |
| 563 | struct bitcoin_tx *replace; |
| 564 | struct amount_sat old_fee = anch->anchor_spend_fee; |
| 565 | |
| 566 | replace = spend_anchor(tal_parent(*tx), channel, anch); |
| 567 | if (replace) { |
| 568 | struct bitcoin_txid txid; |
| 569 | |
| 570 | bitcoin_txid(replace, &txid); |
| 571 | log_info(channel->log, "RBF anchor %s commit tx spend %s: fee was %s now %s", |
| 572 | anch->commit_side == LOCAL ? "local" : "remote", |
| 573 | fmt_bitcoin_txid(tmpctx, &txid), |
| 574 | fmt_amount_sat(tmpctx, old_fee), |
| 575 | fmt_amount_sat(tmpctx, anch->anchor_spend_fee)); |
| 576 | log_debug(channel->log, "RBF anchor spend: Old tx %s new %s", |
| 577 | fmt_bitcoin_tx(tmpctx, *tx), |
| 578 | fmt_bitcoin_tx(tmpctx, replace)); |
| 579 | tal_free(*tx); |
| 580 | *tx = replace; |
| 581 | } |
| 582 | return true; |
| 583 | } |
| 584 | |
| 585 | static void create_and_broadcast_anchor(struct channel *channel, |
| 586 | struct one_anchor *anch) |
nothing calls this directly
no test coverage detected