 |
PRCYCoin
2.0.0.7rc1
P2P Digital Currency
|
Go to the documentation of this file.
12 return error(
"%s: failed to sign block hash with key", __func__);
19 std::vector<valtype> vSolutions;
36 bool fFoundID =
false;
37 for (
const CTxOut& txout :block.
vtx[0].vout) {
44 return error(
"%s: failed to find key for PoW", __func__);
47 return error(
"%s: failed to find key for PoS", __func__);
52 return error(
"%s: failed to get key from keystore", __func__);
63 return error(
"%s: vchBlockSig is empty!", __func__);
70 std::vector<valtype> vSolutions;
71 const CTxOut& txout = block.
vtx[1].vout[1];
75 valtype& vchPubKey = vSolutions[0];
80 return error(
"%s: invalid pubkey %s", __func__, pubkey.
GetHex());
A virtual base class for key stores.
bool IsProofOfWork() const
bool SignBlock(CBlock &block, const CKeyStore &keystore)
A reference to a CKey: the Hash160 of its serialized public key.
std::string GetHex() const
bool SignBlockWithKey(CBlock &block, const CKey &key)
An output of a transaction.
bool Verify(const uint256 &hash, const std::vector< unsigned char > &vchSig) const
Verify a DER signature (~72 bytes).
std::vector< CTransaction > vtx
virtual bool GetKey(const CKeyID &address, CKey &keyOut) const =0
160-bit unsigned big integer.
An encapsulated public key.
An encapsulated private key.
bool Solver(const CKeyStore &keystore, const CScript &scriptPubKey, uint256 hash, int nHashType, CScript &scriptSigRet, txnouttype &whichTypeRet)
Sign scriptPubKey with private keys stored in keystore, given transaction hash and hash type.
bool Sign(const uint256 &hash, std::vector< unsigned char > &vchSig, uint32_t test_case=0) const
Create a DER-serialized signature.
std::vector< unsigned char > valtype
bool CheckBlockSignature(const CBlock &block)
bool GetKeyIDFromUTXO(const CTxOut &txout, CKeyID &keyID)
std::vector< unsigned char > vchBlockSig
bool error(const char *fmt, const Args &... args)
CKeyID GetID() const
Get the KeyID of this public key (hash of its serialization)