OSDN Git Service
(root)
/
bytom
/
vapor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
36ed0fa
)
add_soft_limit for max_tx per block (#555)
author
Paladz
<yzhu101@uottawa.ca>
Thu, 29 Oct 2020 13:53:34 +0000
(21:53 +0800)
committer
GitHub
<noreply@github.com>
Thu, 29 Oct 2020 13:53:34 +0000
(21:53 +0800)
Co-authored-by: paladz <colt@ColtdeMBP.partners>
proposal/proposal.go
patch
|
blob
|
history
diff --git
a/proposal/proposal.go
b/proposal/proposal.go
index
2832c9b
..
9381402
100644
(file)
--- a/
proposal/proposal.go
+++ b/
proposal/proposal.go
@@
-22,6
+22,7
@@
import (
const (
logModule = "mining"
batchApplyNum = 64
+ softMaxTxNum = 128
timeoutOk = iota + 1
timeoutWarn
@@
-119,7
+120,7
@@
func (b *blockBuilder) applyTransactions(txs []*types.Tx, timeoutStatus uint8) e
b.gasLeft = gasLeft
tempTxs = []*types.Tx{}
- if b.getTimeoutStatus() >= timeoutStatus {
+ if b.getTimeoutStatus() >= timeoutStatus
|| len(b.block.Transactions) > softMaxTxNum
{
break
}
}