@@ -1346,7 +1346,7 @@ func TestTransactionPoolUnderpricing(t *testing.T) {
13461346 defer sub .Unsubscribe ()
13471347
13481348 // Create a number of test accounts and fund them
1349- keys := make ([]* ecdsa.PrivateKey , 3 )
1349+ keys := make ([]* ecdsa.PrivateKey , 4 )
13501350 for i := 0 ; i < len (keys ); i ++ {
13511351 keys [i ], _ = crypto .GenerateKey ()
13521352 pool .currentState .AddBalance (crypto .PubkeyToAddress (keys [i ].PublicKey ), big .NewInt (1000000 ))
@@ -1406,18 +1406,22 @@ func TestTransactionPoolUnderpricing(t *testing.T) {
14061406 t .Fatalf ("pool internal state corrupted: %v" , err )
14071407 }
14081408 // Ensure that adding local transactions can push out even higher priced ones
1409- tx := pricedTransaction (1 , 100000 , big .NewInt (0 ), keys [2 ])
1410- if err := pool .AddLocal (tx ); err != nil {
1411- t .Fatalf ("failed to add underpriced local transaction: %v" , err )
1409+ ltx = pricedTransaction (1 , 100000 , big .NewInt (0 ), keys [2 ])
1410+ if err := pool .AddLocal (ltx ); err != nil {
1411+ t .Fatalf ("failed to append underpriced local transaction: %v" , err )
1412+ }
1413+ ltx = pricedTransaction (0 , 100000 , big .NewInt (0 ), keys [3 ])
1414+ if err := pool .AddLocal (ltx ); err != nil {
1415+ t .Fatalf ("failed to add new underpriced local transaction: %v" , err )
14121416 }
14131417 pending , queued = pool .Stats ()
1414- if pending != 2 {
1415- t .Fatalf ("pending transactions mismatched: have %d, want %d" , pending , 2 )
1418+ if pending != 3 {
1419+ t .Fatalf ("pending transactions mismatched: have %d, want %d" , pending , 3 )
14161420 }
1417- if queued != 2 {
1418- t .Fatalf ("queued transactions mismatched: have %d, want %d" , queued , 2 )
1421+ if queued != 1 {
1422+ t .Fatalf ("queued transactions mismatched: have %d, want %d" , queued , 1 )
14191423 }
1420- if err := validateEvents (events , 1 ); err != nil {
1424+ if err := validateEvents (events , 2 ); err != nil {
14211425 t .Fatalf ("local event firing failed: %v" , err )
14221426 }
14231427 if err := validateTxPoolInternals (pool ); err != nil {
0 commit comments