Skip to content

Commit 33a1560

Browse files
committed
getpeginaddress cannot be trusted during ibd, it should fail
1 parent 99e502f commit 33a1560

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/wallet/rpc/elements.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@ RPCHelpMan getpeginaddress()
174174
if (!wallet) return NullUniValue;
175175
CWallet* const pwallet = wallet.get();
176176

177+
if (pwallet->chain().isInitialBlockDownload()) {
178+
throw JSONRPCError(RPC_WALLET_ERROR, "This action cannot be completed during initial sync or reindexing.");
179+
}
180+
177181
LegacyScriptPubKeyMan* spk_man = pwallet->GetLegacyScriptPubKeyMan();
178182
if (!spk_man) {
179183
throw JSONRPCError(RPC_WALLET_ERROR, "This type of wallet does not support this command");

0 commit comments

Comments
 (0)