diff --git a/core/tx_pool.go b/core/tx_pool.go index b91f3d7d53..0f008ddc0d 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -104,7 +104,7 @@ var ( ) // TxStatus is the current status of a transaction as seen py the pool. -type TxStatus int +type TxStatus uint const ( TxStatusUnknown TxStatus = iota diff --git a/les/handler_test.go b/les/handler_test.go index 356a843f4c..9e63e15a60 100644 --- a/les/handler_test.go +++ b/les/handler_test.go @@ -464,6 +464,16 @@ func TestTransactionStatusLes2(t *testing.T) { if _, err := chain.InsertChain(gchain); err != nil { panic(err) } + // wait until TxPool processes the inserted block + for i := 0; i < 10; i++ { + if pending, _ := txpool.Stats(); pending == 1 { + break + } + time.Sleep(100 * time.Millisecond) + } + if pending, _ := txpool.Stats(); pending != 1 { + t.Fatalf("pending count mismatch: have %d, want 1", pending) + } // check if their status is included now block1hash := core.GetCanonicalHash(db, 1)