Validate transactions sender before adding to pool. Closes #272

This commit is contained in:
obscuren
2015-01-31 17:22:17 +01:00
parent 0dfe511370
commit cb382fa76b
2 changed files with 23 additions and 7 deletions

View File

@ -85,3 +85,13 @@ func TestRemoveInvalid(t *testing.T) {
t.Error("expected pool size to be 1, is", pool.Size())
}
}
func TestInvalidSender(t *testing.T) {
pool, _ := setup()
tx := new(types.Transaction)
tx.V = 28
err := pool.ValidateTransaction(tx)
if err != ErrInvalidSender {
t.Error("expected %v, got %v", ErrInvalidSender, err)
}
}