Skip to content

Commit fa28d0f

Browse files
author
MacroFake
committed
scripted-diff: Replace NullUniValue with UniValue::VNULL
This is required for removing the UniValue copy constructor. -BEGIN VERIFY SCRIPT- sed -i 's/return NullUniValue/return UniValue::VNULL/g' $(git grep -l NullUniValue ':(exclude)src/univalue') -END VERIFY SCRIPT-
1 parent fa96210 commit fa28d0f

File tree

12 files changed

+91
-91
lines changed

12 files changed

+91
-91
lines changed

src/rpc/blockchain.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ static RPCHelpMan syncwithvalidationinterfacequeue()
397397
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
398398
{
399399
SyncWithValidationInterfaceQueue();
400-
return NullUniValue;
400+
return UniValue::VNULL;
401401
},
402402
};
403403
}
@@ -1056,11 +1056,11 @@ static RPCHelpMan gettxout()
10561056
LOCK(mempool.cs);
10571057
CCoinsViewMemPool view(coins_view, mempool);
10581058
if (!view.GetCoin(out, coin) || mempool.isSpent(out)) {
1059-
return NullUniValue;
1059+
return UniValue::VNULL;
10601060
}
10611061
} else {
10621062
if (!coins_view->GetCoin(out, coin)) {
1063-
return NullUniValue;
1063+
return UniValue::VNULL;
10641064
}
10651065
}
10661066

@@ -1498,7 +1498,7 @@ static RPCHelpMan preciousblock()
14981498
throw JSONRPCError(RPC_DATABASE_ERROR, state.ToString());
14991499
}
15001500

1501-
return NullUniValue;
1501+
return UniValue::VNULL;
15021502
},
15031503
};
15041504
}
@@ -1539,7 +1539,7 @@ static RPCHelpMan invalidateblock()
15391539
throw JSONRPCError(RPC_DATABASE_ERROR, state.ToString());
15401540
}
15411541

1542-
return NullUniValue;
1542+
return UniValue::VNULL;
15431543
},
15441544
};
15451545
}
@@ -1579,7 +1579,7 @@ static RPCHelpMan reconsiderblock()
15791579
throw JSONRPCError(RPC_DATABASE_ERROR, state.ToString());
15801580
}
15811581

1582-
return NullUniValue;
1582+
return UniValue::VNULL;
15831583
},
15841584
};
15851585
}
@@ -2098,7 +2098,7 @@ static RPCHelpMan scantxoutset()
20982098
CoinsViewScanReserver reserver;
20992099
if (reserver.reserve()) {
21002100
// no scan in progress
2101-
return NullUniValue;
2101+
return UniValue::VNULL;
21022102
}
21032103
result.pushKV("progress", g_scan_progress.load());
21042104
return result;

src/rpc/mining.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ static RPCHelpMan prioritisetransaction()
476476
static UniValue BIP22ValidationResult(const BlockValidationState& state)
477477
{
478478
if (state.IsValid())
479-
return NullUniValue;
479+
return UniValue::VNULL;
480480

481481
if (state.IsError())
482482
throw JSONRPCError(RPC_VERIFY_ERROR, state.ToString());
@@ -1040,7 +1040,7 @@ static RPCHelpMan submitheader()
10401040

10411041
BlockValidationState state;
10421042
chainman.ProcessNewBlockHeaders({h}, state);
1043-
if (state.IsValid()) return NullUniValue;
1043+
if (state.IsValid()) return UniValue::VNULL;
10441044
if (state.IsError()) {
10451045
throw JSONRPCError(RPC_VERIFY_ERROR, state.ToString());
10461046
}

src/rpc/net.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static RPCHelpMan ping()
8484

8585
// Request that each node send a ping during next message processing pass
8686
peerman.SendPings();
87-
return NullUniValue;
87+
return UniValue::VNULL;
8888
},
8989
};
9090
}
@@ -304,7 +304,7 @@ static RPCHelpMan addnode()
304304
{
305305
CAddress addr;
306306
connman.OpenNetworkConnection(addr, false, nullptr, strNode.c_str(), ConnectionType::MANUAL);
307-
return NullUniValue;
307+
return UniValue::VNULL;
308308
}
309309

310310
if (strCommand == "add")
@@ -320,7 +320,7 @@ static RPCHelpMan addnode()
320320
}
321321
}
322322

323-
return NullUniValue;
323+
return UniValue::VNULL;
324324
},
325325
};
326326
}
@@ -423,7 +423,7 @@ static RPCHelpMan disconnectnode()
423423
throw JSONRPCError(RPC_CLIENT_NODE_NOT_CONNECTED, "Node not found in connected nodes");
424424
}
425425

426-
return NullUniValue;
426+
return UniValue::VNULL;
427427
},
428428
};
429429
}
@@ -745,7 +745,7 @@ static RPCHelpMan setban()
745745
throw JSONRPCError(RPC_CLIENT_INVALID_IP_OR_SUBNET, "Error: Unban failed. Requested address/subnet was not previously manually banned.");
746746
}
747747
}
748-
return NullUniValue;
748+
return UniValue::VNULL;
749749
},
750750
};
751751
}
@@ -819,7 +819,7 @@ static RPCHelpMan clearbanned()
819819

820820
node.banman->ClearBanned();
821821

822-
return NullUniValue;
822+
return UniValue::VNULL;
823823
},
824824
};
825825
}

src/rpc/node.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static RPCHelpMan setmocktime()
6565
}
6666
}
6767

68-
return NullUniValue;
68+
return UniValue::VNULL;
6969
},
7070
};
7171
}
@@ -85,7 +85,7 @@ static RPCHelpMan invokedisallowedsyscall()
8585
throw std::runtime_error("invokedisallowedsyscall is used for testing only.");
8686
}
8787
TestDisallowedSandboxCall();
88-
return NullUniValue;
88+
return UniValue::VNULL;
8989
},
9090
};
9191
}
@@ -118,7 +118,7 @@ static RPCHelpMan mockscheduler()
118118
CHECK_NONFATAL(node_context->scheduler);
119119
node_context->scheduler->MockForward(std::chrono::seconds(delta_seconds));
120120

121-
return NullUniValue;
121+
return UniValue::VNULL;
122122
},
123123
};
124124
}

src/wallet/rpc/addresses.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ RPCHelpMan getnewaddress()
3434
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
3535
{
3636
std::shared_ptr<CWallet> const pwallet = GetWalletForJSONRPCRequest(request);
37-
if (!pwallet) return NullUniValue;
37+
if (!pwallet) return UniValue::VNULL;
3838

3939
LOCK(pwallet->cs_wallet);
4040

@@ -86,7 +86,7 @@ RPCHelpMan getrawchangeaddress()
8686
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
8787
{
8888
std::shared_ptr<CWallet> const pwallet = GetWalletForJSONRPCRequest(request);
89-
if (!pwallet) return NullUniValue;
89+
if (!pwallet) return UniValue::VNULL;
9090

9191
LOCK(pwallet->cs_wallet);
9292

@@ -131,7 +131,7 @@ RPCHelpMan setlabel()
131131
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
132132
{
133133
std::shared_ptr<CWallet> const pwallet = GetWalletForJSONRPCRequest(request);
134-
if (!pwallet) return NullUniValue;
134+
if (!pwallet) return UniValue::VNULL;
135135

136136
LOCK(pwallet->cs_wallet);
137137

@@ -148,7 +148,7 @@ RPCHelpMan setlabel()
148148
pwallet->SetAddressBook(dest, label, "send");
149149
}
150150

151-
return NullUniValue;
151+
return UniValue::VNULL;
152152
},
153153
};
154154
}
@@ -181,7 +181,7 @@ RPCHelpMan listaddressgroupings()
181181
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
182182
{
183183
const std::shared_ptr<const CWallet> pwallet = GetWalletForJSONRPCRequest(request);
184-
if (!pwallet) return NullUniValue;
184+
if (!pwallet) return UniValue::VNULL;
185185

186186
// Make sure the results are valid at least up to the most recent block
187187
// the user could have gotten from another RPC command prior to now
@@ -252,7 +252,7 @@ RPCHelpMan addmultisigaddress()
252252
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
253253
{
254254
std::shared_ptr<CWallet> const pwallet = GetWalletForJSONRPCRequest(request);
255-
if (!pwallet) return NullUniValue;
255+
if (!pwallet) return UniValue::VNULL;
256256

257257
LegacyScriptPubKeyMan& spk_man = EnsureLegacyScriptPubKeyMan(*pwallet);
258258

@@ -327,7 +327,7 @@ RPCHelpMan keypoolrefill()
327327
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
328328
{
329329
std::shared_ptr<CWallet> const pwallet = GetWalletForJSONRPCRequest(request);
330-
if (!pwallet) return NullUniValue;
330+
if (!pwallet) return UniValue::VNULL;
331331

332332
if (pwallet->IsLegacy() && pwallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)) {
333333
throw JSONRPCError(RPC_WALLET_ERROR, "Error: Private keys are disabled for this wallet");
@@ -350,7 +350,7 @@ RPCHelpMan keypoolrefill()
350350
throw JSONRPCError(RPC_WALLET_ERROR, "Error refreshing keypool.");
351351
}
352352

353-
return NullUniValue;
353+
return UniValue::VNULL;
354354
},
355355
};
356356
}
@@ -374,14 +374,14 @@ RPCHelpMan newkeypool()
374374
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
375375
{
376376
std::shared_ptr<CWallet> const pwallet = GetWalletForJSONRPCRequest(request);
377-
if (!pwallet) return NullUniValue;
377+
if (!pwallet) return UniValue::VNULL;
378378

379379
LOCK(pwallet->cs_wallet);
380380

381381
LegacyScriptPubKeyMan& spk_man = EnsureLegacyScriptPubKeyMan(*pwallet, true);
382382
spk_man.NewKeyPool();
383383

384-
return NullUniValue;
384+
return UniValue::VNULL;
385385
},
386386
};
387387
}
@@ -548,7 +548,7 @@ RPCHelpMan getaddressinfo()
548548
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
549549
{
550550
const std::shared_ptr<const CWallet> pwallet = GetWalletForJSONRPCRequest(request);
551-
if (!pwallet) return NullUniValue;
551+
if (!pwallet) return UniValue::VNULL;
552552

553553
LOCK(pwallet->cs_wallet);
554554

@@ -658,7 +658,7 @@ RPCHelpMan getaddressesbylabel()
658658
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
659659
{
660660
const std::shared_ptr<const CWallet> pwallet = GetWalletForJSONRPCRequest(request);
661-
if (!pwallet) return NullUniValue;
661+
if (!pwallet) return UniValue::VNULL;
662662

663663
LOCK(pwallet->cs_wallet);
664664

@@ -721,7 +721,7 @@ RPCHelpMan listlabels()
721721
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
722722
{
723723
const std::shared_ptr<const CWallet> pwallet = GetWalletForJSONRPCRequest(request);
724-
if (!pwallet) return NullUniValue;
724+
if (!pwallet) return UniValue::VNULL;
725725

726726
LOCK(pwallet->cs_wallet);
727727

@@ -763,7 +763,7 @@ RPCHelpMan walletdisplayaddress()
763763
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
764764
{
765765
std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request);
766-
if (!wallet) return NullUniValue;
766+
if (!wallet) return UniValue::VNULL;
767767
CWallet* const pwallet = wallet.get();
768768

769769
LOCK(pwallet->cs_wallet);

0 commit comments

Comments
 (0)