|
|
@ -82,7 +82,6 @@ func (node *Node) proposeNewBlock() (*types.Block, error) { |
|
|
|
// Update worker's current header and state data in preparation to propose/process new transactions
|
|
|
|
// Update worker's current header and state data in preparation to propose/process new transactions
|
|
|
|
coinbase := node.Consensus.SelfAddress |
|
|
|
coinbase := node.Consensus.SelfAddress |
|
|
|
|
|
|
|
|
|
|
|
utils.Logger().Info().Msg("11111111111") |
|
|
|
|
|
|
|
// Prepare transactions including staking transactions\
|
|
|
|
// Prepare transactions including staking transactions\
|
|
|
|
pending, err := node.TxPool.Pending() |
|
|
|
pending, err := node.TxPool.Pending() |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
@ -90,13 +89,13 @@ func (node *Node) proposeNewBlock() (*types.Block, error) { |
|
|
|
return nil, err |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
utils.Logger().Info().Msg("222222222222") |
|
|
|
|
|
|
|
// TODO: integrate staking transaction into tx pool
|
|
|
|
// TODO: integrate staking transaction into tx pool
|
|
|
|
pendingStakingTransactions := types2.StakingTransactions{} |
|
|
|
pendingStakingTransactions := types2.StakingTransactions{} |
|
|
|
for _, tx := range node.pendingStakingTransactions { |
|
|
|
for _, tx := range node.pendingStakingTransactions { |
|
|
|
pendingStakingTransactions = append(pendingStakingTransactions, tx) |
|
|
|
pendingStakingTransactions = append(pendingStakingTransactions, tx) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
node.Worker.UpdateCurrent(coinbase) |
|
|
|
if err := node.Worker.CommitTransactions(pending, pendingStakingTransactions, coinbase); err != nil { |
|
|
|
if err := node.Worker.CommitTransactions(pending, pendingStakingTransactions, coinbase); err != nil { |
|
|
|
ctxerror.Log15(utils.GetLogger().Error, |
|
|
|
ctxerror.Log15(utils.GetLogger().Error, |
|
|
|
ctxerror.New("cannot commit transactions"). |
|
|
|
ctxerror.New("cannot commit transactions"). |
|
|
@ -104,7 +103,6 @@ func (node *Node) proposeNewBlock() (*types.Block, error) { |
|
|
|
return nil, err |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
utils.Logger().Info().Msg("33333333333333") |
|
|
|
|
|
|
|
// Prepare cross shard transaction receipts
|
|
|
|
// Prepare cross shard transaction receipts
|
|
|
|
receiptsList := node.proposeReceiptsProof() |
|
|
|
receiptsList := node.proposeReceiptsProof() |
|
|
|
if len(receiptsList) != 0 { |
|
|
|
if len(receiptsList) != 0 { |
|
|
|