Skip to content

Commit 836e9f2

Browse files
committed
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 <[email protected]>
1 parent 8f58af2 commit 836e9f2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

hsmd/libhsmd.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1820,6 +1820,13 @@ static u8 *handle_sign_anchorspend(struct hsmd_client *c, const u8 *msg_in)
18201820
fmt_pubkey(tmpctx, &local_funding_pubkey),
18211821
fmt_wally_psbt(tmpctx, psbt));
18221822
}
1823+
if (dev_warn_on_overgrind
1824+
&& psbt->inputs[0].signatures.num_items == 1
1825+
&& psbt->inputs[0].signatures.items[0].value_len < 71) {
1826+
hsmd_status_fmt(LOG_BROKEN, NULL,
1827+
"overgrind: short signature length %zu",
1828+
psbt->inputs[0].signatures.items[0].value_len);
1829+
}
18231830

18241831
return towire_hsmd_sign_anchorspend_reply(NULL, psbt);
18251832
}

0 commit comments

Comments
 (0)