Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

legacyrpc: add address type arg to getNewAddress #783

Closed
wants to merge 1 commit into from

Commits on Jun 7, 2022

  1. legacyrpc: add address type arg to getNewAddress and getRawChangeAddress

    This handles the AddressType argument in the getNewAddress RPC handler.
    It recognizes "legacy", "p2sh-segwit", and "bech32" to match Bitcoin
    Core's RPC options.  These correspond to bip44, bip49 "plus", and bip84.
    
    These are the waddrmgr.DefaultKeyScopes.
    
    The validateaddress RPC is already able to recognize these addresses,
    and it may be used to verify the addresses returned by getnewaddress.
    
    This adds btcjson.ErrRPCWalletInvalidAddressType with a code (-5) and
    message ("unknown address type") to match Bitcoin Core's v22.
    chappjc committed Jun 7, 2022
    Configuration menu
    Copy the full SHA
    186a4f9 View commit details
    Browse the repository at this point in the history