btcutil/bloom: fix malformed filter test transaction
What changed, and why it matters
This is a one-byte fix in a test file. A test transaction used to exercise the Bloom filter code had an extra trailing zero byte, making it malformed. The change removes that extra byte so the test data is a valid serialized Bitcoin transaction. It does not change any production code, network behavior, or security logic.
No security action required. Treat as a normal test-quality fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In btcutil/bloom/filter_test.go, the TestFilterBloomMatch test constructs a spending transaction from a hard-coded byte slice. The slice contained one byte too many at the end (an extra 0x00), producing an invalid transaction encoding. The patch removes the trailing 0x00 so NewTxFromBytes can parse it correctly. No runtime filter logic is modified.
Changed components
btcutil/bloom/filter_test.goInspect captured patch +1 / −1
diff --git a/btcutil/bloom/filter_test.go b/btcutil/bloom/filter_test.go
index a16d21e..1b61eb0 100644
--- a/btcutil/bloom/filter_test.go
+++ b/btcutil/bloom/filter_test.go
@@ -325,7 +325,7 @@ func TestFilterBloomMatch(t *testing.T) {
0x02, 0x00, 0x00, 0x00, 0x00, 0x19, 0x76, 0xa9, 0x14,
0xc1, 0x09, 0x32, 0x48, 0x3f, 0xec, 0x93, 0xed, 0x51,
0xf5, 0xfe, 0x95, 0xe7, 0x25, 0x59, 0xf2, 0xcc, 0x70,
- 0x43, 0xf9, 0x88, 0xac, 0x00, 0x00, 0x00, 0x00, 0x00}
+ 0x43, 0xf9, 0x88, 0xac, 0x00, 0x00, 0x00, 0x00}
spendingTx, err := btcutil.NewTxFromBytes(spendingTxBytes)
if err != nil {
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.