Validation of pegin inputs

This commit is contained in:
Steven Roose 2018-12-12 11:44:04 +01:00
parent f4adb464e8
commit 5cbb014fe4
15 changed files with 369 additions and 79 deletions

View file

@ -34,6 +34,7 @@ static const char DB_LAST_BLOCK = 'l';
// ELEMENTS:
static const char DB_PEGIN_FLAG = 'w';
static const char DB_INVALID_BLOCK_Q = 'q';
namespace {
@ -270,6 +271,14 @@ bool CBlockTreeDB::ReadFlag(const std::string &name, bool &fValue) {
return true;
}
// ELEMENTS:
bool CBlockTreeDB::ReadInvalidBlockQueue(std::vector<uint256> &vBlocks) {
return Read(std::make_pair(DB_INVALID_BLOCK_Q, uint256S("0")), vBlocks);//FIXME: why uint 56 and not ""
}
bool CBlockTreeDB::WriteInvalidBlockQueue(const std::vector<uint256> &vBlocks) {
return Write(std::make_pair(DB_INVALID_BLOCK_Q, uint256S("0")), vBlocks);
}
bool CBlockTreeDB::LoadBlockIndexGuts(const Consensus::Params& consensusParams, std::function<CBlockIndex*(const uint256&)> insertBlockIndex)
{
std::unique_ptr<CDBIterator> pcursor(NewIterator());