()
| 164 | } |
| 165 | |
| 166 | func (b *branch) sortUnpackedTxs() (txs []pi.Transaction) { |
| 167 | txs = make([]pi.Transaction, 0, len(b.unpacked)) |
| 168 | for _, v := range b.unpacked { |
| 169 | txs = append(txs, v) |
| 170 | } |
| 171 | sort.Slice(txs, func(i, j int) bool { |
| 172 | if cmp := bytes.Compare( |
| 173 | hash.Hash(txs[i].GetAccountAddress()).AsBytes(), |
| 174 | hash.Hash(txs[j].GetAccountAddress()).AsBytes(), |
| 175 | ); cmp != 0 { |
| 176 | return cmp < 0 |
| 177 | } |
| 178 | return txs[i].GetAccountNonce() < txs[j].GetAccountNonce() |
| 179 | }) |
| 180 | return |
| 181 | } |
| 182 | |
| 183 | func (b *branch) produceBlock( |
| 184 | h uint32, ts time.Time, addr proto.AccountAddress, signer *ca.PrivateKey, |
no test coverage detected