mirror of
https://gitee.com/BTAJL/repchain.git
synced 2024-12-04 12:48:32 +08:00
repchain2.0-update90:修改从交易池装载数据的方法,增加循环变量修改和增加数值不能小于零的判断。
This commit is contained in:
parent
a68d5f1568
commit
ffc7a0e69d
@ -54,7 +54,7 @@ class PoolOfTransaction(ctx:RepChainSystemContext) {
|
||||
this.serialOfTransaction.set(last.get)
|
||||
val trs = new ArrayBuffer[Transaction]()
|
||||
var limit = last.get
|
||||
val tb = this.db.getBytes(this.cache_transaction_serial_tx_prefix+last.get)
|
||||
var tb = this.db.getBytes(this.cache_transaction_serial_tx_prefix+last.get)
|
||||
while (tb != null){
|
||||
val t = Transaction.parseFrom(tb)
|
||||
if(this.isExist(t.id)){
|
||||
@ -63,6 +63,10 @@ class PoolOfTransaction(ctx:RepChainSystemContext) {
|
||||
trs += t
|
||||
}
|
||||
limit -= 1
|
||||
if(limit >= 0)
|
||||
tb = this.db.getBytes(this.cache_transaction_serial_tx_prefix+limit)
|
||||
else
|
||||
tb = null
|
||||
}
|
||||
if(trs.length > 0){
|
||||
this.addTransactionToCaches(trs,false)
|
||||
|
Loading…
Reference in New Issue
Block a user