File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -1363,7 +1363,18 @@ RPCHelpMan importmulti()
1363
1363
UniValue response (UniValue::VARR);
1364
1364
{
1365
1365
LOCK (pwallet->cs_wallet );
1366
- EnsureWalletIsUnlocked (*pwallet);
1366
+
1367
+ // Check all requests are watchonly
1368
+ bool is_watchonly{true };
1369
+ for (size_t i = 0 ; i < requests.size (); ++i) {
1370
+ const UniValue& request = requests[i];
1371
+ if (!request.exists (" watchonly" ) || !request[" watchonly" ].get_bool ()) {
1372
+ is_watchonly = false ;
1373
+ break ;
1374
+ }
1375
+ }
1376
+ // Wallet does not need to be unlocked if all requests are watchonly
1377
+ if (!is_watchonly) EnsureWalletIsUnlocked (wallet);
1367
1378
1368
1379
// Verify all timestamps are present before importing any keys.
1369
1380
CHECK_NONFATAL (pwallet->chain ().findBlock (pwallet->GetLastBlockHash (), FoundBlock ().time (nLowestTimestamp).mtpTime (now)));
You can’t perform that action at this time.
0 commit comments