mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 20:42:59 +01:00
Use hash after transaction was mined
- Prevents an attacker from gaming which masternodes they'll use
This commit is contained in:
parent
712eb7e9d9
commit
2a0d3dfb9d
@ -63,7 +63,13 @@ void ProcessMessageInstantX(CNode* pfrom, std::string& strCommand, CDataStream&
|
||||
return;
|
||||
}
|
||||
}
|
||||
int nBlockHeight = chainActive.Tip()->nHeight - nTxAge; //calculate the height
|
||||
|
||||
/*
|
||||
Use a blockheight newer than the input.
|
||||
This prevents attackers from using transaction mallibility to predict which masternodes
|
||||
they'll use.
|
||||
*/
|
||||
int nBlockHeight = (chainActive.Tip()->nHeight - nTxAge)+4;
|
||||
|
||||
BOOST_FOREACH(const CTxOut o, tx.vout){
|
||||
if(!o.scriptPubKey.IsNormalPaymentScript()){
|
||||
@ -342,7 +348,7 @@ void CleanTransactionLocksList()
|
||||
|
||||
if(mapTxLockReq.count(it->second.txHash)){
|
||||
CTransaction& tx = mapTxLockReq[it->second.txHash];
|
||||
|
||||
|
||||
BOOST_FOREACH(const CTxIn& in, tx.vin)
|
||||
mapLockedInputs.erase(in.prevout);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user