diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2015-11-06 01:42:38 +0100 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2016-06-22 15:42:59 +0200 |
commit | 8b49040854be2e26b66366aeae1cba4716f93d93 (patch) | |
tree | b217f3fb71bc0745c1f74ab239fbe0ebcf52a751 /src/main.h | |
parent | 449f9b8debcceb61a92043bc7031528a53627c47 (diff) |
BIP141: Commitment structure and deployment
Includes a fix by Suhas Daftuar and LongShao007
Diffstat (limited to 'src/main.h')
-rw-r--r-- | src/main.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.h b/src/main.h index f004a29bb1..d0dce70687 100644 --- a/src/main.h +++ b/src/main.h @@ -453,6 +453,15 @@ bool DisconnectBlock(const CBlock& block, CValidationState& state, const CBlockI /** Check a block is completely valid from start to finish (only works on top of our current best block, with cs_main held) */ bool TestBlockValidity(CValidationState& state, const CChainParams& chainparams, const CBlock& block, CBlockIndex* pindexPrev, bool fCheckPOW = true, bool fCheckMerkleRoot = true); +/** Check whether witness commitments are required for block. */ +bool IsWitnessEnabled(const CBlockIndex* pindexPrev, const Consensus::Params& params); + +/** Update uncommitted block structures (currently: only the witness nonce). This is safe for submitted blocks. */ +void UpdateUncommittedBlockStructures(CBlock& block, const CBlockIndex* pindexPrev, const Consensus::Params& consensusParams); + +/** Produce the necessary coinbase commitment for a block (modifies the hash, don't call for mined blocks). */ +std::vector<unsigned char> GenerateCoinbaseCommitment(CBlock& block, const CBlockIndex* pindexPrev, const Consensus::Params& consensusParams); + /** RAII wrapper for VerifyDB: Verify consistency of the block and coin databases */ class CVerifyDB { public: |