pytest: fix feerate check in test_peer_anchor_push

We didn't log when anchor transactions had short signatures,
which causes this test to not assert (did_short_sig):

```
            total_feerate_perkw = total_fees / total_weight * 1000
>           check_feerate([l3, l2], total_feerate_perkw, feerate)

tests/test_closing.py:4063: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

nodes = [<fixtures.LightningNode object at 0x7f0fb322bb20>, <fixtures.LightningNode object at 0x7f0fb1b5ead0>]
actual_feerate = 14006.105538595726, expected_feerate = 14000

    def check_feerate(nodes, actual_feerate, expected_feerate):
        # Feerate can't be lower.
        assert actual_feerate > expected_feerate - 2
        if actual_feerate >= expected_feerate + 2:
            if any([did_short_sig(n) for n in nodes]):
                return
        # Use assert as it shows the actual values on failure
>       assert actual_feerate < expected_feerate + 2
E       AssertionError
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2026-01-07 09:54:11 +10:30
parent 9443487e96
commit 8a60a27662

View File

@@ -1820,6 +1820,13 @@ static u8 *handle_sign_anchorspend(struct hsmd_client *c, const u8 *msg_in)
fmt_pubkey(tmpctx, &local_funding_pubkey),
fmt_wally_psbt(tmpctx, psbt));
}
if (dev_warn_on_overgrind
&& psbt->inputs[0].signatures.num_items == 1
&& psbt->inputs[0].signatures.items[0].value_len < 71) {
hsmd_status_fmt(LOG_BROKEN, NULL,
"overgrind: short signature length %zu",
psbt->inputs[0].signatures.items[0].value_len);
}
return towire_hsmd_sign_anchorspend_reply(NULL, psbt);
}