Skip to content

Commit

Permalink
rpc/generatetoaddress: Reject Silent Payment addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
Eunovo committed Oct 1, 2024
1 parent 6f442fa commit 115d59c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/rpc/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@

#include <memory>
#include <stdint.h>
#include <variant>

using node::BlockAssembler;
using node::CBlockTemplate;
Expand Down Expand Up @@ -285,6 +286,9 @@ static RPCHelpMan generatetoaddress()
if (!IsValidDestination(destination)) {
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Error: Invalid address");
}
if (std::get_if<V0SilentPaymentDestination>(&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);
Expand Down

0 comments on commit 115d59c

Please sign in to comment.