mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
Change initial issuance output to 1
This commit is contained in:
parent
7a3720a1d5
commit
1136ad3a96
6 changed files with 160 additions and 151 deletions
|
|
@ -2067,7 +2067,16 @@ bool ApplyTxInUndo(const CTxInUndo& undo, CCoinsViewCache& view, const COutPoint
|
|||
CCoinsModifier coins = view.ModifyCoins(out.hash);
|
||||
if (undo.nHeight != 0 ||
|
||||
// Special-case genesis since nHeight is always 0, assume DB is clean
|
||||
(Params().GenesisBlock().vtx[0]->GetHash() == out.hash && coins->IsPruned())) {
|
||||
(Params().GenesisBlock().vtx[0]->GetHash() == out.hash && coins->IsPruned()) ||
|
||||
// Special-case for initial issuance since being a single output nHeight is always 0
|
||||
(Params().GenesisBlock().vtx.size() > 1 && [&]() {
|
||||
for (const auto& tx : Params().GenesisBlock().vtx) {
|
||||
if (tx->GetHash() == out.hash) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}() && coins->IsPruned())) {
|
||||
// undo data contains height: this is the last output of the prevout tx being spent
|
||||
if (!coins->IsPruned())
|
||||
fClean = fClean && error("%s: undo data overwriting existing transaction", __func__);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue