Commit f6fa7e28 authored by 李伟@五瓣科技's avatar 李伟@五瓣科技

fix percet

parent db4d6fbb
...@@ -480,9 +480,25 @@ func (web *WebServicer) ProduceTxs(fromAddr string, toAddrs []string, txCount in ...@@ -480,9 +480,25 @@ func (web *WebServicer) ProduceTxs(fromAddr string, toAddrs []string, txCount in
consTxNum := 0 consTxNum := 0
addrsL := len(toAddrs) addrsL := len(toAddrs)
first := true first := true
total := txCount
if fromAddr != systemFromAddr && first {
total = total + 1
}
for ; ; consTxNum++ {
total = total - batchTxHashSize*batchTxSize
if total <= 0 {
break
}
}
SetSendRecord(id, SendRecord{TotalConsTx: int64(consTxNum)})
for { for {
var hashesBytes []byte = make([]byte, 0, 32*batchTxHashSize) var hashesBytes []byte = make([]byte, 0, 32*batchTxHashSize)
...@@ -583,14 +599,10 @@ func (web *WebServicer) ProduceTxs(fromAddr string, toAddrs []string, txCount in ...@@ -583,14 +599,10 @@ func (web *WebServicer) ProduceTxs(fromAddr string, toAddrs []string, txCount in
Tx: tx, Tx: tx,
BatchTxHash: hashesBytes} BatchTxHash: hashesBytes}
consTxNum++
if txCount == 0 { if txCount == 0 {
break break
} }
} }
SetSendRecord(id, SendRecord{TotalConsTx: int64(consTxNum)})
return nil return nil
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment