]>
Commit | Line | Data |
---|---|---|
1 | /******************************************************************** | |
2 | * (C) 2018 Michael Toutonghi | |
3 | * | |
4 | * Distributed under the MIT software license, see the accompanying | |
5 | * file COPYING or http://www.opensource.org/licenses/mit-license.php. | |
6 | * | |
7 | * This crypto-condition eval solves the problem of nothing-at-stake | |
8 | * in a proof of stake consensus system. | |
9 | * | |
10 | */ | |
11 | ||
12 | #ifndef STAKEGUARD_H | |
13 | #define STAKEGUARD_H | |
14 | ||
15 | #include <vector> | |
16 | ||
17 | #include "CCinclude.h" | |
18 | #include "streams.h" | |
19 | #include "script/script.h" | |
20 | ||
21 | #define DEFAULT_STAKE_TXFEE 0 | |
22 | ||
23 | bool UnpackStakeOpRet(const CTransaction &stakeTx, std::vector<std::vector<unsigned char>> &vData); | |
24 | ||
25 | bool GetStakeParams(const CTransaction &stakeTx, CStakeParams &stakeParams); | |
26 | ||
27 | bool ValidateStakeTransaction(const CTransaction &stakeTx, CStakeParams &stakeParams, bool validateSig = true); | |
28 | ||
29 | bool ValidateMatchingStake(const CTransaction &ccTx, uint32_t voutNum, const CTransaction &stakeTx, bool &cheating); | |
30 | ||
31 | bool MakeGuardedOutput(CAmount value, CPubKey &dest, CTransaction &stakeTx, CTxOut &vout); | |
32 | ||
33 | bool MakeCheatEvidence(CMutableTransaction &mtx, const CTransaction &ccTx, uint32_t voutNum, const CTransaction &cheatTx); | |
34 | ||
35 | bool StakeGuardValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx, uint32_t nIn, bool fulfilled); | |
36 | ||
37 | bool IsStakeGuardInput(const CScript &scriptSig); | |
38 | ||
39 | UniValue StakeGuardInfo(); | |
40 | ||
41 | #endif |