|
|
@ -175,14 +175,17 @@ func (node *Node) ProposeNewBlock(commitSigs chan []byte) (*types.Block, error) |
|
|
|
plainTxsPerAcc := types.Transactions{} |
|
|
|
plainTxsPerAcc := types.Transactions{} |
|
|
|
for _, tx := range poolTxs { |
|
|
|
for _, tx := range poolTxs { |
|
|
|
if plainTx, ok := tx.(*types.Transaction); ok { |
|
|
|
if plainTx, ok := tx.(*types.Transaction); ok { |
|
|
|
|
|
|
|
utils.Logger().Info().Str("tx_hash", tx.Hash().Hex()).Msg("add transaction to proposing block") |
|
|
|
plainTxsPerAcc = append(plainTxsPerAcc, plainTx) |
|
|
|
plainTxsPerAcc = append(plainTxsPerAcc, plainTx) |
|
|
|
} else if stakingTx, ok := tx.(*staking.StakingTransaction); ok { |
|
|
|
} else if stakingTx, ok := tx.(*staking.StakingTransaction); ok { |
|
|
|
// Only process staking transactions after pre-staking epoch happened.
|
|
|
|
// Only process staking transactions after pre-staking epoch happened.
|
|
|
|
if node.Blockchain().Config().IsPreStaking(node.Worker.GetCurrentHeader().Epoch()) { |
|
|
|
if node.Blockchain().Config().IsPreStaking(node.Worker.GetCurrentHeader().Epoch()) { |
|
|
|
|
|
|
|
utils.Logger().Info().Str("tx_hash", tx.Hash().Hex()).Msg("add staking transaction to proposing block") |
|
|
|
pendingStakingTxs = append(pendingStakingTxs, stakingTx) |
|
|
|
pendingStakingTxs = append(pendingStakingTxs, stakingTx) |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
utils.Logger().Err(types.ErrUnknownPoolTxType). |
|
|
|
utils.Logger().Err(types.ErrUnknownPoolTxType). |
|
|
|
|
|
|
|
Str("tx_hash", tx.Hash().Hex()). |
|
|
|
Msg("Failed to parse pending transactions") |
|
|
|
Msg("Failed to parse pending transactions") |
|
|
|
return nil, types.ErrUnknownPoolTxType |
|
|
|
return nil, types.ErrUnknownPoolTxType |
|
|
|
} |
|
|
|
} |
|
|
|