mirror of
https://github.com/dashpay/dash.git
synced 2024-12-28 05:23:01 +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;
|
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){
|
BOOST_FOREACH(const CTxOut o, tx.vout){
|
||||||
if(!o.scriptPubKey.IsNormalPaymentScript()){
|
if(!o.scriptPubKey.IsNormalPaymentScript()){
|
||||||
|
Loading…
Reference in New Issue
Block a user