@@ -537,7 +537,7 @@ UniValue importwallet(const JSONRPCRequest& request)
537
537
file.close ();
538
538
pwallet->ShowProgress (" " , 100 ); // hide progress dialog in GUI
539
539
pwallet->UpdateTimeFirstKey (nTimeBegin);
540
- pwallet->RescanFromTime (nTimeBegin - TIMESTAMP_WINDOW , false /* update */ );
540
+ pwallet->RescanFromTime (nTimeBegin, false /* update */ );
541
541
pwallet->MarkDirty ();
542
542
543
543
if (!fGood )
@@ -1113,10 +1113,10 @@ UniValue importmulti(const JSONRPCRequest& mainRequest)
1113
1113
}
1114
1114
1115
1115
if (fRescan && fRunScan && requests.size ()) {
1116
- int64_t scannedTime = pwallet->RescanFromTime (nLowestTimestamp - TIMESTAMP_WINDOW , true /* update */ );
1116
+ int64_t scannedTime = pwallet->RescanFromTime (nLowestTimestamp, true /* update */ );
1117
1117
pwallet->ReacceptWalletTransactions ();
1118
1118
1119
- if (scannedTime > nLowestTimestamp - TIMESTAMP_WINDOW ) {
1119
+ if (scannedTime > nLowestTimestamp) {
1120
1120
std::vector<UniValue> results = response.getValues ();
1121
1121
response.clear ();
1122
1122
response.setArray ();
@@ -1126,7 +1126,7 @@ UniValue importmulti(const JSONRPCRequest& mainRequest)
1126
1126
// range, or if the import result already has an error set, let
1127
1127
// the result stand unmodified. Otherwise replace the result
1128
1128
// with an error message.
1129
- if (scannedTime <= GetImportTimestamp (request, now) - TIMESTAMP_WINDOW || results.at (i).exists (" error" )) {
1129
+ if (scannedTime <= GetImportTimestamp (request, now) || results.at (i).exists (" error" )) {
1130
1130
response.push_back (results.at (i));
1131
1131
} else {
1132
1132
UniValue result = UniValue (UniValue::VOBJ);
@@ -1142,7 +1142,7 @@ UniValue importmulti(const JSONRPCRequest& mainRequest)
1142
1142
" caused by pruning or data corruption (see bitcoind log for details) and could "
1143
1143
" be dealt with by downloading and rescanning the relevant blocks (see -reindex "
1144
1144
" and -rescan options)." ,
1145
- GetImportTimestamp (request, now), scannedTime - 1 , TIMESTAMP_WINDOW)));
1145
+ GetImportTimestamp (request, now), scannedTime - TIMESTAMP_WINDOW - 1 , TIMESTAMP_WINDOW)));
1146
1146
response.push_back (std::move (result));
1147
1147
}
1148
1148
++i;
0 commit comments