forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Sidechain half of Drivechains & BMM (#2)
* Add updated SCDB, remove subsidy, add GUI elements * Remove old SCDB files * Remove unused script operator * Update sidechain database * Update validation and miner * Update sidechain page * Update sidechain client * Remove unused * Pushing some initial work on BMM - Removed PoW files - Added BMM files - Added BMM based chain activation code - Modified block header for BMM - h* validation * Update sidechain client - Added validate critical hash (h*) call * Remove unused PoW related rpc calls * Add BMM tab to sidechain page * BMM update
- Loading branch information
Showing
57 changed files
with
2,759 additions
and
2,181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include "bmm.h" | ||
|
||
#include "primitives/block.h" | ||
|
||
BMM::BMM() | ||
{ | ||
|
||
} | ||
|
||
bool BMM::StoreBMMBlock(const CBlock& block) | ||
{ | ||
if (!block.vtx.size()) | ||
return false; | ||
|
||
uint256 hashBlock = block.GetHash(); | ||
|
||
// Already have block stored | ||
if (mapBMMBlocks.find(hashBlock) != mapBMMBlocks.end()) | ||
return false; | ||
|
||
mapBMMBlocks[hashBlock] = block; | ||
|
||
return true; | ||
} | ||
|
||
bool BMM::GetBMMBlock(const uint256& hashBlock, CBlock& block) | ||
{ | ||
if (mapBMMBlocks.find(hashBlock) == mapBMMBlocks.end()) | ||
return false; | ||
|
||
block = mapBMMBlocks[hashBlock]; | ||
|
||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#ifndef BITCOIN_BMM_H | ||
#define BITCOIN_BMM_H | ||
|
||
#include "uint256.h" | ||
|
||
#include <map> | ||
|
||
class CBlock; | ||
|
||
class BMM | ||
{ | ||
public: | ||
BMM(); | ||
|
||
bool StoreBMMBlock(const CBlock& block); | ||
|
||
bool GetBMMBlock(const uint256& hashBlock, CBlock& block); | ||
|
||
private: | ||
std::map<uint256, CBlock> mapBMMBlocks; | ||
}; | ||
|
||
#endif // BITCOIN_BMM_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.