Make sure mixing masternode follows bip69 before signing final mixing tx (#1510)

* Make sure mixing tx follows bip69 before signing it

* bump MIN_PRIVATESEND_PEER_PROTO_VERSION to 70208
This commit is contained in:
UdjinM6 2017-09-22 04:53:15 +03:00 committed by GitHub
parent 502748487d
commit ea793a71f1
2 changed files with 13 additions and 1 deletions

View File

@ -492,6 +492,18 @@ bool CPrivateSendClient::SignFinalTransaction(const CTransaction& finalTransacti
finalMutableTransaction = finalTransactionNew; finalMutableTransaction = finalTransactionNew;
LogPrintf("CPrivateSendClient::SignFinalTransaction -- finalMutableTransaction=%s", finalMutableTransaction.ToString()); LogPrintf("CPrivateSendClient::SignFinalTransaction -- finalMutableTransaction=%s", finalMutableTransaction.ToString());
// Make sure it's BIP69 compliant
sort(finalMutableTransaction.vin.begin(), finalMutableTransaction.vin.end(), CompareInputBIP69());
sort(finalMutableTransaction.vout.begin(), finalMutableTransaction.vout.end(), CompareOutputBIP69());
if(finalMutableTransaction.GetHash() != finalTransactionNew.GetHash()) {
LogPrintf("CPrivateSendClient::SignFinalTransaction -- WARNING! Masternode %s is not BIP69 compliant!\n", infoMixingMasternode.vin.prevout.ToStringShort());
UnlockCoins();
keyHolderStorage.ReturnAll();
SetNull();
return false;
}
std::vector<CTxIn> sigs; std::vector<CTxIn> sigs;
//make sure my inputs/outputs are present, otherwise refuse to sign //make sure my inputs/outputs are present, otherwise refuse to sign

View File

@ -22,7 +22,7 @@ static const int PRIVATESEND_QUEUE_TIMEOUT = 30;
static const int PRIVATESEND_SIGNING_TIMEOUT = 15; static const int PRIVATESEND_SIGNING_TIMEOUT = 15;
//! minimum peer version accepted by mixing pool //! minimum peer version accepted by mixing pool
static const int MIN_PRIVATESEND_PEER_PROTO_VERSION = 70206; static const int MIN_PRIVATESEND_PEER_PROTO_VERSION = 70208;
static const CAmount PRIVATESEND_ENTRY_MAX_SIZE = 9; static const CAmount PRIVATESEND_ENTRY_MAX_SIZE = 9;