ElementsProject / ElementsProject/elements

getnewaddress generates invalid bech32 addresses in regtest

Open
#1,092 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.2k
Forks
416
Avg merge
1d 23h
Merged PRs (30d)
15

Description

**Expected behavior**

When calling `getnewaddress` and then `getaddressinfo` on the newly generated address, it should work and return the address info, not an error.

**Actual behavior**

`getaddressinfo` returns:
```
error code: -5
error message:
Invalid address
```

but only for bech32 addresses and apparently only in `regtest` chain. Legacy and p2sh-segwit seems to work fine.

**To reproduce**

Just starts a fresh node in `regtest` mode, and type the 2 commands.

**System information**

Tried on 2 different machines with elements 0.18.1.7 and 0.18.1.12:
1. Linux sosthene01 5.13.0-28-generic # 31~20.04.1-Ubuntu SMP Wed Jan 19 14:08:10 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
2. Linux sosthene02 5.13.0-27-generic # 29~20.04.1-Ubuntu SMP Fri Jan 14 00:32:30 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.