mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
Merge pull request #172 from instagibbs/locksarebitcoin
Only track locks with explicit asset types that are bitcoin
This commit is contained in:
commit
39ae188683
1 changed files with 3 additions and 2 deletions
|
|
@ -3106,7 +3106,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
|
|||
vPos.push_back(std::make_pair(tx.GetHash(), pos));
|
||||
for (unsigned int i = 0; i < tx.vout.size(); i++) {
|
||||
CTxOut txout= tx.vout[i];
|
||||
if (txout.scriptPubKey.IsWithdrawLock() && txout.nValue.IsExplicit())
|
||||
if (txout.scriptPubKey.IsWithdrawLock() && txout.nValue.IsExplicit() && txout.nAsset.IsExplicit() && txout.nAsset.GetAsset() == BITCOINID)
|
||||
mLocksCreated.insert(std::make_pair(txout.scriptPubKey.GetWithdrawLockGenesisHash(), std::make_pair(COutPoint(tx.GetHash(), i), txout.nValue.GetAmount())));
|
||||
}
|
||||
|
||||
|
|
@ -3289,8 +3289,9 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
|
|||
|
||||
for (unsigned int j = 0; j < tx.vout.size(); j++) {
|
||||
CTxOut txout = tx.vout[j];
|
||||
if (txout.scriptPubKey.IsWithdrawLock() && txout.nValue.IsExplicit())
|
||||
if (txout.scriptPubKey.IsWithdrawLock() && txout.nValue.IsExplicit() && txout.nAsset.IsExplicit() && txout.nAsset.GetAsset() == BITCOINID) {
|
||||
mLocksCreated.insert(std::make_pair(txout.scriptPubKey.GetWithdrawLockGenesisHash(), std::make_pair(COutPoint(tx.GetHash(), j), txout.nValue.GetAmount())));
|
||||
}
|
||||
}
|
||||
if (!tx.HasValidFee())
|
||||
return state.DoS(100, error("ConnectBlock(): transaction fee overflowed"), REJECT_INVALID, "bad-fee-outofrange");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue