From 1c6d389cb7dc4bc6a7edb08c68359c952e8f1c23 Mon Sep 17 00:00:00 2001 From: Jowen Date: Thu, 14 Jun 2018 16:19:15 +0800 Subject: [PATCH] revert get_previous_tx from pool, without lock. --- src/lib/blockchain/validate_transaction.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/blockchain/validate_transaction.cpp b/src/lib/blockchain/validate_transaction.cpp index f0e20f0bb..ea6c22778 100644 --- a/src/lib/blockchain/validate_transaction.cpp +++ b/src/lib/blockchain/validate_transaction.cpp @@ -212,8 +212,11 @@ bool validate_transaction::get_previous_tx(chain::transaction& prev_tx, { prev_height = 0; if (pool_) { - if (blockchain_.get_transaction(input.previous_output.hash, prev_tx, prev_height)) { - return true; // find in block chain or memory pool + if (blockchain_.get_transaction(prev_tx, prev_height, input.previous_output.hash)) { + return true; // find in block chain + } + if (pool_->find(prev_tx, input.previous_output.hash)) { + return true; // find in memory pool } } else {