Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge neo-project #1

Merged
merged 6 commits into from
Jan 20, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add ContainsTransaction Recheck when ParallelVerifiedTransaction Rece…
…ived (neo-project#1408)

* add containsTx recheck

* add UT

* Update to just View check

* update

* revert

* Update UT_Blockchain.cs

Co-authored-by: Vitor Nazário Coelho <vncoelho@gmail.com>
eryeer and vncoelho committed Jan 13, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 49b8518a4805aa8dea40a432211a3037e8896be3
4 changes: 3 additions & 1 deletion src/neo/Ledger/Blockchain.cs
Original file line number Diff line number Diff line change
@@ -429,7 +429,9 @@ private void OnParallelVerified(ParallelVerified parallelVerified)
RelayResultReason reason = parallelVerified.VerifyResult;
if (reason == RelayResultReason.Succeed)
{
if (!MemPool.CanTransactionFitInPool(parallelVerified.Transaction))
if (View.ContainsTransaction(parallelVerified.Transaction.Hash))
reason = RelayResultReason.AlreadyExists;
else if (!MemPool.CanTransactionFitInPool(parallelVerified.Transaction))
reason = RelayResultReason.OutOfMemory;
else if (!MemPool.TryAdd(parallelVerified.Transaction.Hash, parallelVerified.Transaction))
reason = RelayResultReason.OutOfMemory;