Skip to content

Commit ddc8468

Browse files
author
lazyluis
committed
clean code
1 parent 1ec1548 commit ddc8468

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

bech32/bech32.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -288,18 +288,12 @@ func Decode(bech string, limit int) (string, []byte, error) {
288288
length := len(data)
289289

290290
if strings.HasPrefix(bech, BITCOIN_HRP) {
291-
hrp = SIDE_HRP // return "side" for segwit/taproot
291+
hrp = SIDE_HRP // return "side" for segwit/taproot to pass verification
292292
}
293293

294-
println("decode length", length)
295294
// decode taproot address
296-
if length == 53 {
297-
if strings.HasPrefix(bech, BITCOIN_HRP) {
298-
data = data[1:]
299-
} else {
300-
// data = data
301-
// data, err = ConvertBits(data, 8, 5, true)
302-
}
295+
if strings.HasPrefix(bech, BITCOIN_HRP) && length == 53 {
296+
data = data[1:]
303297
}
304298

305299
// decode segwit address

0 commit comments

Comments
 (0)