block and uncle reward in PoA network = 0 (#87)
* in PoA networks there is no block and uncle rewards * bump meta version
This commit is contained in:
parent
f2f37f0b89
commit
b64ca14689
@ -24,7 +24,7 @@ const (
|
|||||||
VersionMajor = 1 // Major version component of the current release
|
VersionMajor = 1 // Major version component of the current release
|
||||||
VersionMinor = 10 // Minor version component of the current release
|
VersionMinor = 10 // Minor version component of the current release
|
||||||
VersionPatch = 3 // Patch version component of the current release
|
VersionPatch = 3 // Patch version component of the current release
|
||||||
VersionMeta = "statediff-0.0.23" // Version metadata to append to the version string
|
VersionMeta = "statediff-0.0.24" // Version metadata to append to the version string
|
||||||
)
|
)
|
||||||
|
|
||||||
// Version holds the textual version string.
|
// Version holds the textual version string.
|
||||||
|
@ -119,7 +119,13 @@ func (sdi *StateDiffIndexer) PushBlock(block *types.Block, receipts types.Receip
|
|||||||
return nil, fmt.Errorf("expected number of transactions (%d), transaction trie nodes (%d), receipts (%d), and receipt trie nodes (%d)to be equal", len(txNodes), len(txTrieNodes), len(rctNodes), len(rctTrieNodes))
|
return nil, fmt.Errorf("expected number of transactions (%d), transaction trie nodes (%d), receipts (%d), and receipt trie nodes (%d)to be equal", len(txNodes), len(txTrieNodes), len(rctNodes), len(rctTrieNodes))
|
||||||
}
|
}
|
||||||
// Calculate reward
|
// Calculate reward
|
||||||
reward := CalcEthBlockReward(block.Header(), block.Uncles(), block.Transactions(), receipts)
|
var reward *big.Int
|
||||||
|
// in PoA networks block reward is 0
|
||||||
|
if sdi.chainConfig.Clique != nil {
|
||||||
|
reward = big.NewInt(0)
|
||||||
|
} else {
|
||||||
|
reward = CalcEthBlockReward(block.Header(), block.Uncles(), block.Transactions(), receipts)
|
||||||
|
}
|
||||||
t = time.Now()
|
t = time.Now()
|
||||||
// Begin new db tx for everything
|
// Begin new db tx for everything
|
||||||
tx, err := sdi.dbWriter.db.Beginx()
|
tx, err := sdi.dbWriter.db.Beginx()
|
||||||
@ -238,7 +244,13 @@ func (sdi *StateDiffIndexer) processUncles(tx *sqlx.Tx, headerID int64, blockNum
|
|||||||
if err := shared.PublishIPLD(tx, uncleNode); err != nil {
|
if err := shared.PublishIPLD(tx, uncleNode); err != nil {
|
||||||
return fmt.Errorf("error publishing uncle IPLD: %v", err)
|
return fmt.Errorf("error publishing uncle IPLD: %v", err)
|
||||||
}
|
}
|
||||||
uncleReward := CalcUncleMinerReward(blockNumber, uncleNode.Number.Uint64())
|
var uncleReward *big.Int
|
||||||
|
// in PoA networks uncle reward is 0
|
||||||
|
if sdi.chainConfig.Clique != nil {
|
||||||
|
uncleReward = big.NewInt(0)
|
||||||
|
} else {
|
||||||
|
uncleReward = CalcUncleMinerReward(blockNumber, uncleNode.Number.Uint64())
|
||||||
|
}
|
||||||
uncle := models.UncleModel{
|
uncle := models.UncleModel{
|
||||||
CID: uncleNode.Cid().String(),
|
CID: uncleNode.Cid().String(),
|
||||||
MhKey: shared.MultihashKeyFromCID(uncleNode.Cid()),
|
MhKey: shared.MultihashKeyFromCID(uncleNode.Cid()),
|
||||||
|
Loading…
Reference in New Issue
Block a user