diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index d41ec5bdc6201..dc12825f606d2 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -43,6 +43,7 @@ #include #include +#include using node::BlockAssembler; using node::CBlockTemplate; @@ -285,6 +286,9 @@ static RPCHelpMan generatetoaddress() if (!IsValidDestination(destination)) { throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Error: Invalid address"); } + if (std::get_if(&destination)) { + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Error: Cannot pay to Silent Payment Output in Coinbase transactions"); + } NodeContext& node = EnsureAnyNodeContext(request.context); Mining& miner = EnsureMining(node);