From 192d23327c7ff83db96b3d13195e42d78c983c90 Mon Sep 17 00:00:00 2001 From: Zsolt Felfoldi Date: Tue, 24 Oct 2017 20:06:21 +0200 Subject: [PATCH] les: fixed tx status test and rlp encoding --- core/tx_pool.go | 2 +- les/handler_test.go | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) 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)