Skip to content

Commit 266a811

Browse files
committed
Use MTP for importmulti "now" timestamps
1 parent 3cf9917 commit 266a811

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

qa/rpc-tests/importmulti.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def run_test (self):
139139
# Address + Private key + !watchonly
140140
print("Should import an address with private key")
141141
address = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())
142-
timestamp = self.nodes[1].getblock(self.nodes[1].getbestblockhash())['time']
142+
timestamp = self.nodes[1].getblock(self.nodes[1].getbestblockhash())['mediantime']
143143
result = self.nodes[1].importmulti([{
144144
"scriptPubKey": {
145145
"address": address['address']

src/wallet/rpcdump.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ UniValue importmulti(const JSONRPCRequest& mainRequest)
10341034
EnsureWalletIsUnlocked();
10351035

10361036
// Verify all timestamps are present before importing any keys.
1037-
const int64_t now = chainActive.Tip() ? chainActive.Tip()->GetBlockTime() : 0;
1037+
const int64_t now = chainActive.Tip() ? chainActive.Tip()->GetMedianTimePast() : 0;
10381038
for (const UniValue& data : requests.getValues()) {
10391039
GetImportTimestamp(data, now);
10401040
}

0 commit comments

Comments
 (0)