@@ -1346,7 +1346,7 @@ func TestTransactionPoolUnderpricing(t *testing.T) {
1346
1346
defer sub .Unsubscribe ()
1347
1347
1348
1348
// Create a number of test accounts and fund them
1349
- keys := make ([]* ecdsa.PrivateKey , 3 )
1349
+ keys := make ([]* ecdsa.PrivateKey , 4 )
1350
1350
for i := 0 ; i < len (keys ); i ++ {
1351
1351
keys [i ], _ = crypto .GenerateKey ()
1352
1352
pool .currentState .AddBalance (crypto .PubkeyToAddress (keys [i ].PublicKey ), big .NewInt (1000000 ))
@@ -1406,18 +1406,22 @@ func TestTransactionPoolUnderpricing(t *testing.T) {
1406
1406
t .Fatalf ("pool internal state corrupted: %v" , err )
1407
1407
}
1408
1408
// 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 )
1412
1416
}
1413
1417
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 )
1416
1420
}
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 )
1419
1423
}
1420
- if err := validateEvents (events , 1 ); err != nil {
1424
+ if err := validateEvents (events , 2 ); err != nil {
1421
1425
t .Fatalf ("local event firing failed: %v" , err )
1422
1426
}
1423
1427
if err := validateTxPoolInternals (pool ); err != nil {
0 commit comments