diff options
author | Andrew Chow <achow101-github@achow101.com> | 2019-06-27 21:17:42 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2019-07-24 11:42:46 -0400 |
commit | 78941da5baf6244c7c54e86cf8ce3e09ce60c239 (patch) | |
tree | fc07b9173f4adcb604fe2242ed4b2b579c0b1c2e /src/wallet/rpcdump.cpp | |
parent | 94bf156f391759420465b2ff8c44f5f150246c7f (diff) |
Optionally allow ImportScripts to set script creation timestamp
Behavior changes:
* scripts imported in importmulti that are not explicilty scriptPubKeys will have timestamps set for them
Diffstat (limited to 'src/wallet/rpcdump.cpp')
-rw-r--r-- | src/wallet/rpcdump.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index 964676e6b1..480832c627 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -194,7 +194,7 @@ UniValue importprivkey(const JSONRPCRequest& request) // Add the wpkh script for this key if possible if (pubkey.IsCompressed()) { - pwallet->ImportScripts({GetScriptForDestination(WitnessV0KeyHash(vchAddress))}); + pwallet->ImportScripts({GetScriptForDestination(WitnessV0KeyHash(vchAddress))}, 0 /* timestamp */); } } } @@ -316,7 +316,7 @@ UniValue importaddress(const JSONRPCRequest& request) CScript redeem_script(data.begin(), data.end()); std::set<CScript> scripts = {redeem_script}; - pwallet->ImportScripts(scripts); + pwallet->ImportScripts(scripts, 0 /* timestamp */); if (fP2SH) { scripts.insert(GetScriptForDestination(ScriptHash(CScriptID(redeem_script)))); @@ -1251,7 +1251,7 @@ static UniValue ProcessImport(CWallet * const pwallet, const UniValue& data, con // All good, time to import pwallet->MarkDirty(); - if (!pwallet->ImportScripts(import_data.import_scripts)) { + if (!pwallet->ImportScripts(import_data.import_scripts, timestamp)) { throw JSONRPCError(RPC_WALLET_ERROR, "Error adding script to wallet"); } if (!pwallet->ImportPrivKeys(privkey_map, timestamp)) { |