`addwitnessaddress` should have a `rescan` option similar to `importprivkey` #10016

issue pinheadmz opened this issue on March 16, 2017
  1. pinheadmz commented at 9:30 PM on March 16, 2017: member

    Sorry if this has been addressed already.

    With Wallet-1: getnewaddress and addwitnessaddress. Then also dumpprivkey.

    After moving files around and restarting with Wallet-2: importprivkey and also addwitnessaddress which gives me the same P2SH-enclosed witness address as Wallet-1, I need to rescan the blockchain for the wallet to update.

    Is there a way to wallet-rescan from bitcoin-cli? or some behavior similar to importprivkey rescan=true?

  2. fanquake added the label RPC/REST/ZMQ on Mar 17, 2017
  3. laanwj added the label Wallet on Aug 24, 2017
  4. laanwj commented at 9:26 AM on August 24, 2017: member

    After moving files around and restarting with Wallet-2: importprivkey and also addwitnessaddress which gives me the same P2SH-enclosed witness address as Wallet-1, I need to rescan the blockchain for the wallet to update.

    importmulti, which is a superset of the various import functions, supports this by providing a key birthday.

    Is there a way to wallet-rescan from bitcoin-cli? or some behavior similar to importprivkey rescan=true?

    No, the only way to do a full rescan is by restarting bitcoind with -rescan.

  5. promag commented at 1:16 PM on August 24, 2017: member

    :+1: on importmulti with timestamp. @pinheadmz there is a patch for RPC rescan, see #7061.

  6. pinheadmz commented at 4:39 PM on August 24, 2017: member

    Will this work for a P2WPKH nested in BIP16 P2SH? If there is an old transaction on the blockchain with a P2SH output and the redeem script is a witness PKH that I generated with addwitnessaddress, how should I import and scan for that tx? Would I use importmulti with the redeemscript option ? And if so, how do I get the actual redeem script for the P2SH address generated by addwitnessaddress?

  7. Sjors commented at 2:58 PM on March 16, 2018: member

    addwitnessaddress is now deprecated.

  8. meshcollider closed this on Mar 17, 2018

  9. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me