mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
fix: Corrently parse non-testnet p2pkh addresses
The return value of `b58check` is negative on failure, and positive values are the address version, i.e., 0 in the case of mainnet addresses.
This commit is contained in:
committed by
Rusty Russell
parent
e80ef7dc19
commit
954b2c4a67
@@ -61,7 +61,7 @@ static bool from_base58(u8 *version,
|
||||
int r = b58check(buf, sizeof(buf), base58, base58_len);
|
||||
*version = buf[0];
|
||||
memcpy(rmd, buf + 1, sizeof(*rmd));
|
||||
return r > 0;
|
||||
return r >= 0;
|
||||
}
|
||||
|
||||
bool bitcoin_from_base58(bool *test_net,
|
||||
|
||||
Reference in New Issue
Block a user