HomePhabricator

rpc: creates possibility to preserve labels on importprivkey

Description

rpc: creates possibility to preserve labels on importprivkey

Summary:

  • changes importprivkey behavior to overwrite existent label if one

is passed and keep existing ones if no label is passed

  • tests behavior of importprivkey on existing address labels and

different same key destination

This is a backport of Core PR13381 .

I had to modify heavily the last test to create a P2SH manually. Bitcoin Core does produce a segwit wrapped into P2SH address by default so this isn't a problem for them.

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Subscribers: majcosta

Differential Revision: https://reviews.bitcoinabc.org/D6185

Details

Provenance
marcoagner <marco@agner.io>Authored on Oct 5 2018, 12:33
deadalnixCommitted on May 21 2020, 01:19
deadalnixPushed on May 21 2020, 01:19
Reviewer
Restricted Project
Differential Revision
D6185: rpc: creates possibility to preserve labels on importprivkey
Parents
rABCd7437bcdf746: [backport#16349] Remove redundant WalletController::addWallet slot
Branches
Unknown
Tags
Unknown