importmulti with a specific timestamp, the wallet’s nTimeFirstKey will be set to 1.
I think we should add a optional timestamp to CWallet::AddWatchOnly() and use it when importing addresses or pubkeys.
importmulti with a specific timestamp, the wallet’s nTimeFirstKey will be set to 1.
I think we should add a optional timestamp to CWallet::AddWatchOnly() and use it when importing addresses or pubkeys.
Changing CWallet::AddWatchOnly() to
0bool AddWatchOnly(const CScript &dest, const int64_t &nTimeKey = 1);
and pass the specific timestamp in ProcessImportMulti() should fix right?
"watchs" in the database) do not have a corresponding metadata object.
First, we should consider adding a metadata objects for those. Second, we need to define how we deal with wallets containing watch-only objects without metadata (probably assume we need to rescan back to genesis in oder to detect related funds, as we do in current master).
IMO this issue is not related to the importmulti RPC call but related to CWallet::AddWatchOnly().
importmulti is only a shortcut for several wallet operations, with an optional timestamp used only for rescan the blockchain from a given timestamp.
As the wallet always handles WatchOnly objects with nTimeFirstKey = 1, we should not associate importmulti with this wallet issue.