mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
pre merge
This commit is contained in:
parent
4cebc6eb4a
commit
322b4d3a5b
4 changed files with 11 additions and 11 deletions
|
|
@ -41,7 +41,10 @@ var (
|
|||
ByzantiumBlockReward *big.Int = big.NewInt(3e+18) // Block reward in wei for successfully mining a block upward from Byzantium
|
||||
maxUncles = 2 // Maximum number of uncles allowed in a single block
|
||||
allowedFutureBlockTime = 15 * time.Second // Max time from current time allowed for blocks, before they're considered future blocks
|
||||
//@note: @shyft
|
||||
//@note: @shyft This is the Shyft block reward numbers
|
||||
// ShyftNetworkBlockReward = Block reward for the shyft conduit contract.
|
||||
// ShyftMinerBlockReward = Block reward for the miner.
|
||||
// ShyftNetworkConduitAddress = Shyft conduit contract
|
||||
ShyftNetworkBlockReward *big.Int = big.NewInt(2.5e+18) // Block reward in wei for successfully mining a block, for the Shyft Network
|
||||
ShyftMinerBlockReward *big.Int = big.NewInt(2.5e+18) // Block reward in wei for successfully mining a block, for the Shyft Network
|
||||
ShyftNetworkConduitAddress = common.HexToAddress("9db76b4bbaea76dfda4552b7b9d4e9d43abc55fd")
|
||||
|
|
|
|||
|
|
@ -267,7 +267,7 @@ func newCanonical(engine consensus.Engine, n int, full bool) (ethdb.Database, *B
|
|||
headers := makeHeaderChain(genesis.Header(), n, engine, db, canonicalSeed)
|
||||
foo, err := blockchain.InsertHeaderChain(headers, 1)
|
||||
// foo is so the compiler doesn't complain
|
||||
// @shyft remove this
|
||||
// @NOTE:SHYFT @TODO: remove this.
|
||||
fmt.Println(foo)
|
||||
return db, blockchain, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,7 +103,6 @@ func (s *Ethereum) AddLesServer(ls LesServer) {
|
|||
// New creates a new Ethereum object (including the
|
||||
// initialisation of the common Ethereum object)
|
||||
func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
|
||||
// @NOTE:shyft Where we instantiate BlockExplorerDB
|
||||
if config.SyncMode == downloader.LightSync {
|
||||
return nil, errors.New("can't run eth.Ethereum in light sync mode, use les.LightEthereum")
|
||||
}
|
||||
|
|
@ -115,7 +114,8 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// @NOTE:shyft instantiate BlockExplorerDB here?
|
||||
// @NOTE:shyft instantiate BlockExplorerDB here
|
||||
// @TODO: Create Genesis Block
|
||||
blockExplorerDb, err := leveldb.OpenFile("./shyftData/geth/blockExplorerDb/", nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
|
|
@ -49,14 +49,12 @@ type ShyftAccountEntry struct {
|
|||
}
|
||||
|
||||
func WriteBlock(db *leveldb.DB, block *types.Block) error {
|
||||
fmt.Println("+++++++++++++++++++++++++++ BLOCK NUMBER", block.Number())
|
||||
fmt.Println("+++++++++++++++++++++++++++ # of TX", len(block.Transactions()))
|
||||
leng := block.Transactions().Len()
|
||||
var tx_strs = make([]string, leng)
|
||||
//var tx_bytes = make([]byte, leng)
|
||||
hash := block.Header().Hash().Bytes()
|
||||
|
||||
fmt.Println("The tx_strs is")
|
||||
fmt.Println(tx_strs)
|
||||
//strs := []string{"foo", "bar"}
|
||||
buf := &bytes.Buffer{}
|
||||
gob.NewEncoder(buf).Encode(tx_strs)
|
||||
bs := buf.Bytes()
|
||||
|
|
@ -71,7 +69,6 @@ func WriteBlock(db *leveldb.DB, block *types.Block) error {
|
|||
if block.Transactions().Len() > 0 {
|
||||
for i, tx := range block.Transactions() {
|
||||
tx_strs[i] = WriteTransactions(db, tx, block.Header().Hash())
|
||||
//tx_bytes[i] = tx.Hash().Bytes()
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
|
@ -167,7 +164,7 @@ func WriteToBalance(db *leveldb.DB, tx *types.Transaction) {
|
|||
// @NOTE: This function is extremely complex and requires heavy testing and knowdlege of edge cases:
|
||||
// uncle blocks, account balance updates based on reorgs, diverges that get dropped.
|
||||
// Reason for this is because the accounts are not deterministic like the block and tx hashes.
|
||||
// @TODO: Calculate reward from uncles
|
||||
// @TODO: Calculate reward if there are uncles
|
||||
// @TODO: Calculate mining reward (most likely retrieve higher up in the operations)
|
||||
// @TODO: Calculate reorg
|
||||
func WriteMinerReward(db *leveldb.DB, block *types.Block) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue