Browse Source

Use MTP for importmulti "now" timestamps

0.14
Russell Yanofsky 8 years ago
parent
commit
266a8114cb
  1. 2
      qa/rpc-tests/importmulti.py
  2. 2
      src/wallet/rpcdump.cpp

2
qa/rpc-tests/importmulti.py

@ -139,7 +139,7 @@ class ImportMultiTest (BitcoinTestFramework): @@ -139,7 +139,7 @@ class ImportMultiTest (BitcoinTestFramework):
# Address + Private key + !watchonly
print("Should import an address with private key")
address = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())
timestamp = self.nodes[1].getblock(self.nodes[1].getbestblockhash())['time']
timestamp = self.nodes[1].getblock(self.nodes[1].getbestblockhash())['mediantime']
result = self.nodes[1].importmulti([{
"scriptPubKey": {
"address": address['address']

2
src/wallet/rpcdump.cpp

@ -1034,7 +1034,7 @@ UniValue importmulti(const JSONRPCRequest& mainRequest) @@ -1034,7 +1034,7 @@ UniValue importmulti(const JSONRPCRequest& mainRequest)
EnsureWalletIsUnlocked();
// Verify all timestamps are present before importing any keys.
const int64_t now = chainActive.Tip() ? chainActive.Tip()->GetBlockTime() : 0;
const int64_t now = chainActive.Tip() ? chainActive.Tip()->GetMedianTimePast() : 0;
for (const UniValue& data : requests.getValues()) {
GetImportTimestamp(data, now);
}

Loading…
Cancel
Save