mirror of
https://github.com/monero-project/monero.git
synced 2024-11-18 00:37:43 +00:00
Merge pull request #562
d4c2fae
BlockchainDB: Remove txs in reverse order (warptangent)
This commit is contained in:
commit
c35501c6ad
1 changed files with 5 additions and 3 deletions
|
@ -26,6 +26,8 @@
|
|||
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <boost/range/adaptor/reversed.hpp>
|
||||
|
||||
#include "blockchain_db.h"
|
||||
#include "cryptonote_core/cryptonote_format_utils.h"
|
||||
#include "profile_tools.h"
|
||||
|
@ -133,13 +135,13 @@ void BlockchainDB::pop_block(block& blk, std::vector<transaction>& txs)
|
|||
blk = get_top_block();
|
||||
|
||||
remove_block();
|
||||
|
||||
remove_transaction(get_transaction_hash(blk.miner_tx));
|
||||
for (const auto& h : blk.tx_hashes)
|
||||
|
||||
for (const auto& h : boost::adaptors::reverse(blk.tx_hashes))
|
||||
{
|
||||
txs.push_back(get_tx(h));
|
||||
remove_transaction(h);
|
||||
}
|
||||
remove_transaction(get_transaction_hash(blk.miner_tx));
|
||||
}
|
||||
|
||||
bool BlockchainDB::is_open() const
|
||||
|
|
Loading…
Reference in a new issue