Skip to content

Commit 22feb7f

Browse files
committed
Merge bitcoin/bitcoin#23577: Follow-ups to Bech32 error detection
a4fe701 Make Bech32 LocateErrors return error list rather than using out-arg (Samuel Dobson) 2fa4fd1 Use std::iota instead of manually pushing range (Samuel Dobson) 405c96f Use bounds-checked array lookups in Bech32 error detection code (Samuel Dobson) 28d9c28 Simplify encoding of e in GF(1024) tables to (1,0) (Samuel Dobson) 14358a0 Replace GF1024 tables and syndrome constants with compile-time generated constexprs. (Samuel Dobson) 63f7b69 Update release note for bech32 error detection (Samuel Dobson) c8b9a22 Report encoding type in bech32 error message (Samuel Dobson) 92f0caf Improve Bech32 boost tests (Samuel Dobson) bb4d3e9 Address review comments for Bech32 error validation (Samuel Dobson) Pull request description: A number of follow-ups and improvements to the bech32 error location code, introduced in #16807. Notably, this removes the hardcoded GF1024 tables in favour of constexpr table generation. ACKs for top commit: laanwj: Re-ACK a4fe701 Tree-SHA512: 6312373c20ebd6636f5797304876fa0d70fa777de2f6c507245f51a652b3d1224ebc55b236c9e11e6956c1e88e65faadab51d53587078efccb451455aa2e2276
2 parents d20d6ac + a4fe701 commit 22feb7f

File tree

6 files changed

+233
-323
lines changed

6 files changed

+233
-323
lines changed

doc/release-notes-16807.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Updated RPCs
22
------------
33

4-
- The `validateaddress` RPC now optionally returns an `error_locations` array, with the indices of
5-
invalid characters in the address. For example, this will return the locations of up to two Bech32
6-
errors.
4+
- The `validateaddress` RPC now returns an `error_locations` array for invalid
5+
addresses, with the indices of invalid character locations in the address (if
6+
known). For example, this will attempt to locate up to two Bech32 errors, and
7+
return their locations if successful. Success and correctness are only guaranteed
8+
if fewer than two substitution errors have been made.
9+
The error message returned in the `error` field now also returns more specific
10+
errors when decoding fails.

0 commit comments

Comments
 (0)