Require timestamps for importmulti keys

Additionally, accept a "now" timestamp, to allow avoiding rescans for keys
which are known never to have been used.

Note that the behavior when "now" is specified is slightly different than the
previous behavior when no timestamp was specified at all. Previously, when no
timestamp was specified, it would avoid rescanning during the importmulti call,
but set the key's nCreateTime value to 1, which would not prevent future block
reads in later ScanForWalletTransactions calls. With this change, passing a
"now" timestamp will set the key's nCreateTime to the current block time
instead of 1.

Fixes #9491
This commit is contained in:
Russell Yanofsky
2017-02-03 16:23:13 -05:00
parent 02464da5e4
commit 442887f27f
3 changed files with 64 additions and 9 deletions

View File

@@ -33,6 +33,7 @@ def call_import_rpc(call, data, address, scriptPubKey, pubkey, key, label, node,
"scriptPubKey": {
"address": address
},
"timestamp": "now",
"pubkeys": [pubkey] if data == Data.pub else [],
"keys": [key] if data == Data.priv else [],
"label": label,