12 #include <unordered_set> 24 return stake.getPubkey().VerifySchnorr(stake.getHash(proofid),
sig);
44 total += s.getStake().getAmount();
47 return uint32_t((100 * total) /
COIN);
57 std::unordered_set<COutPoint, SaltedOutpointHasher> utxos;
59 const Stake &s = ss.getStake();
64 if (!utxos.insert(s.
getUTXO()).second) {
68 if (!ss.verify(proofid)) {
83 const Stake &s = ss.getStake();
87 if (!view.
GetCoin(utxo, coin)) {
113 PKHash *pkhash = boost::get<PKHash>(&dest);
121 if (*pkhash !=
PKHash(pubkey)) {
std::array< uint8_t, 64 > sig
static constexpr Amount zero()
bool ExtractDestination(const CScript &scriptPubKey, CTxDestination &addressRet)
Parse a standard scriptPubKey for the destination address.
static constexpr Amount PROOF_DUST_THRESOLD
virtual bool GetCoin(const COutPoint &outpoint, Coin &coin) const
Retrieve the Coin (unspent transaction output) for a given outpoint.
void WriteCompactSize(CSizeComputer &os, uint64_t nSize)
uint32_t getScore() const
static constexpr Amount SATOSHI
bool verify(const ProofId &proofid) const
uint256 getHash(const ProofId &proofid) const
ProofId computeProofId() const
const COutPoint & getUTXO() const
bool Invalid(Result result, const std::string &reject_reason="", const std::string &debug_message="")
static constexpr Amount COIN
Abstract view on the open txout dataset.
An encapsulated public key.
const CPubKey & getPubkey() const
An output of a transaction.
bool verify(ProofValidationState &state) const
An outpoint - a combination of a transaction hash and an index n into its vout.
uint32_t GetHeight() const
uint32_t getHeight() const
A writer stream (for serialization) that computes a 256-bit hash.
boost::variant< CNoDestination, PKHash, ScriptHash > CTxDestination
A txout script template with a specific destination.