mirror of
https://github.com/dashpay/dash.git
synced 2024-12-28 05:23:01 +01:00
Use MTP for importmulti "now" timestamps
This commit is contained in:
parent
3cf991756c
commit
266a8114cb
@ -139,7 +139,7 @@ class ImportMultiTest (BitcoinTestFramework):
|
|||||||
# Address + Private key + !watchonly
|
# Address + Private key + !watchonly
|
||||||
print("Should import an address with private key")
|
print("Should import an address with private key")
|
||||||
address = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())
|
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([{
|
result = self.nodes[1].importmulti([{
|
||||||
"scriptPubKey": {
|
"scriptPubKey": {
|
||||||
"address": address['address']
|
"address": address['address']
|
||||||
|
@ -1034,7 +1034,7 @@ UniValue importmulti(const JSONRPCRequest& mainRequest)
|
|||||||
EnsureWalletIsUnlocked();
|
EnsureWalletIsUnlocked();
|
||||||
|
|
||||||
// Verify all timestamps are present before importing any keys.
|
// 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()) {
|
for (const UniValue& data : requests.getValues()) {
|
||||||
GetImportTimestamp(data, now);
|
GetImportTimestamp(data, now);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user