core: filter out txes with system fee > MaxBlockSystemFee

They can stay in the memory pool forever because consensus process will never
accept these transactions (and maybe even block consensus process at all).
This commit is contained in:
Roman Khimov 2022-11-29 10:31:00 +03:00
parent a43a87675d
commit 6847e1760c
2 changed files with 9 additions and 0 deletions

View file

@ -1131,6 +1131,12 @@ func TestBlockchain_VerifyTx(t *testing.T) {
require.NoError(t, accs[0].SignTx(netmode.UnitTestNet, tx))
checkErr(t, core.ErrInsufficientFunds, tx)
})
t.Run("TooBigSystemFee", func(t *testing.T) {
tx := newTestTx(t, h, testScript)
tx.SystemFee = bc.GetConfig().MaxBlockSystemFee + 100500
require.NoError(t, accs[0].SignTx(netmode.UnitTestNet, tx))
checkErr(t, core.ErrPolicy, tx)
})
t.Run("TooBigTx", func(t *testing.T) {
script := make([]byte, transaction.MaxTransactionSize)
tx := newTestTx(t, h, script)