mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-06 19:06:42 +01:00
Merge pull request #523 from hermeznetwork/feature/pooll2tx-info
Add PoolL2Tx.Info about the status of the tx
This commit is contained in:
@@ -293,6 +293,7 @@ func (p *Pipeline) forgeBatch(batchNum common.BatchNum) (batchInfo *BatchInfo, e
|
||||
}
|
||||
|
||||
var poolL2Txs []common.PoolL2Tx
|
||||
var discardedL2Txs []common.PoolL2Tx
|
||||
var l1UserTxsExtra, l1CoordTxs []common.L1Tx
|
||||
var auths [][]byte
|
||||
var coordIdxs []common.Idx
|
||||
@@ -316,14 +317,14 @@ func (p *Pipeline) forgeBatch(batchNum common.BatchNum) (batchInfo *BatchInfo, e
|
||||
if err != nil {
|
||||
return nil, tracerr.Wrap(err)
|
||||
}
|
||||
coordIdxs, auths, l1UserTxsExtra, l1CoordTxs, poolL2Txs, err =
|
||||
coordIdxs, auths, l1UserTxsExtra, l1CoordTxs, poolL2Txs, discardedL2Txs, err =
|
||||
p.txSelector.GetL1L2TxSelection(selectionCfg, l1UserTxs)
|
||||
if err != nil {
|
||||
return nil, tracerr.Wrap(err)
|
||||
}
|
||||
} else {
|
||||
// 2b: only L2 txs
|
||||
coordIdxs, auths, l1CoordTxs, poolL2Txs, err =
|
||||
coordIdxs, auths, l1CoordTxs, poolL2Txs, discardedL2Txs, err =
|
||||
p.txSelector.GetL2TxSelection(selectionCfg)
|
||||
if err != nil {
|
||||
return nil, tracerr.Wrap(err)
|
||||
@@ -341,6 +342,9 @@ func (p *Pipeline) forgeBatch(batchNum common.BatchNum) (batchInfo *BatchInfo, e
|
||||
if err := p.l2DB.StartForging(common.TxIDsFromPoolL2Txs(poolL2Txs), batchInfo.BatchNum); err != nil {
|
||||
return nil, tracerr.Wrap(err)
|
||||
}
|
||||
if err := p.l2DB.UpdateTxsInfo(discardedL2Txs); err != nil {
|
||||
return nil, tracerr.Wrap(err)
|
||||
}
|
||||
|
||||
// Invalidate transactions that become invalid beause of
|
||||
// the poolL2Txs selected. Will mark as invalid the txs that have a
|
||||
|
||||
Reference in New Issue
Block a user