Skip to content

Commit e49f039

Browse files
committed
fixup! Return errors from importmulti if complete rescans are not successful
Add missing response.setArray call and fix string formatting issue pointed out #9773 (comment)
1 parent 455b8f7 commit e49f039

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/wallet/rpcdump.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,7 @@ UniValue importmulti(const JSONRPCRequest& mainRequest)
10831083
if (!scannedRange || scannedRange->nHeight > pindex->nHeight) {
10841084
std::vector<UniValue> results = response.getValues();
10851085
response.clear();
1086+
response.setArray();
10861087
size_t i = 0;
10871088
for (const UniValue& request : requests.getValues()) {
10881089
// If key creation date is within the successfully scanned
@@ -1094,7 +1095,7 @@ UniValue importmulti(const JSONRPCRequest& mainRequest)
10941095
} else {
10951096
UniValue result = UniValue(UniValue::VOBJ);
10961097
result.pushKV("success", UniValue(false));
1097-
result.pushKV("error", JSONRPCError(RPC_MISC_ERROR, strprintf("Failed to rescan before time %" PRId64 ", transactions may be missing.", (long long)scannedRange->GetBlockTimeMax())));
1098+
result.pushKV("error", JSONRPCError(RPC_MISC_ERROR, strprintf("Failed to rescan before time %" PRId64 ", transactions may be missing.", scannedRange->GetBlockTimeMax())));
10981099
response.push_back(std::move(result));
10991100
}
11001101
}

0 commit comments

Comments
 (0)