diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-08-29 22:44:17 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-08-29 22:44:17 +0100 |
commit | 1cdba42a77f7dfae3028c4bf106e247ea7c033fd (patch) | |
tree | e0d66f70d15cbde6153a543221355e04e8b7c618 /src | |
parent | Merge pull request #1006 (diff) | |
download | monero-1cdba42a77f7dfae3028c4bf106e247ea7c033fd.tar.xz |
db_lmdb: fix reorg with "halfway rct" coinbase outputs
Diffstat (limited to 'src')
-rw-r--r-- | src/blockchain_db/lmdb/db_lmdb.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp index a0a0a041d..c0cf28dda 100644 --- a/src/blockchain_db/lmdb/db_lmdb.cpp +++ b/src/blockchain_db/lmdb/db_lmdb.cpp @@ -877,10 +877,12 @@ void BlockchainLMDB::remove_tx_outputs(const uint64_t tx_id, const transaction& throw0(DB_ERROR("tx has outputs, but no output indices found")); } + bool is_miner_tx = tx.vin.size() == 1 && tx.vin[0].type() == typeid(txin_gen); for (uint64_t i = tx.vout.size(); i > 0; --i) { const tx_out tx_output = tx.vout[i-1]; - remove_output(tx_output.amount, amount_output_indices[i-1]); + uint64_t amount = is_miner_tx && tx.version >= 2 ? 0 : tx_output.amount; + remove_output(amount, amount_output_indices[i-1]); } } |