Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dpos): generate block with sponsor tx
Browse files Browse the repository at this point in the history
RainFallsSilent committed Jan 20, 2025
1 parent c834e8f commit 1862b6e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pow/service.go
Original file line number Diff line number Diff line change
@@ -300,6 +300,9 @@ func (pow *Service) GenerateBlock(minerAddr string,
}

msgBlock.Transactions = append(msgBlock.Transactions, coinBaseTx)
txCount := 1
totalTxsSize := coinBaseTx.GetSize()
totalTxFee := common.Fixed64(0)

if bestChain.Height+1 >= pow.chainParams.DPoSConfiguration.RecordSponsorStartHeight {
bestBlock, err := pow.chain.GetDposBlockByHash(*bestChain.Hash)
@@ -312,14 +315,12 @@ func (pow *Service) GenerateBlock(minerAddr string,
return nil, err
}
msgBlock.Transactions = append(msgBlock.Transactions, recordSponsorTx)
txCount++
totalTxsSize += recordSponsorTx.GetSize()
}
}

totalTxsSize := coinBaseTx.GetSize()
txCount := 1
totalTxFee := common.Fixed64(0)
txs := pow.txMemPool.GetTxsInPool()

isHighPriority := func(tx interfaces.Transaction) bool {
if tx.IsRevertToPOW() || tx.IsRevertToDPOS() ||
tx.IsIllegalTypeTx() || tx.IsInactiveArbitrators() ||
@@ -344,7 +345,6 @@ func (pow *Service) GenerateBlock(minerAddr string,

var proposalsUsedAmount common.Fixed64
for _, tx := range txs {

if tx.IsRecordSponorTx() {
continue
}

0 comments on commit 1862b6e

Please sign in to comment.