Skip to content

Commit ea793a7

Browse files
authored
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
1 parent 5027484 commit ea793a7

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/privatesend-client.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,18 @@ bool CPrivateSendClient::SignFinalTransaction(const CTransaction& finalTransacti
492492
finalMutableTransaction = finalTransactionNew;
493493
LogPrintf("CPrivateSendClient::SignFinalTransaction -- finalMutableTransaction=%s", finalMutableTransaction.ToString());
494494

495+
// Make sure it's BIP69 compliant
496+
sort(finalMutableTransaction.vin.begin(), finalMutableTransaction.vin.end(), CompareInputBIP69());
497+
sort(finalMutableTransaction.vout.begin(), finalMutableTransaction.vout.end(), CompareOutputBIP69());
498+
499+
if(finalMutableTransaction.GetHash() != finalTransactionNew.GetHash()) {
500+
LogPrintf("CPrivateSendClient::SignFinalTransaction -- WARNING! Masternode %s is not BIP69 compliant!\n", infoMixingMasternode.vin.prevout.ToStringShort());
501+
UnlockCoins();
502+
keyHolderStorage.ReturnAll();
503+
SetNull();
504+
return false;
505+
}
506+
495507
std::vector<CTxIn> sigs;
496508

497509
//make sure my inputs/outputs are present, otherwise refuse to sign

src/privatesend.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ static const int PRIVATESEND_QUEUE_TIMEOUT = 30;
2222
static const int PRIVATESEND_SIGNING_TIMEOUT = 15;
2323

2424
//! minimum peer version accepted by mixing pool
25-
static const int MIN_PRIVATESEND_PEER_PROTO_VERSION = 70206;
25+
static const int MIN_PRIVATESEND_PEER_PROTO_VERSION = 70208;
2626

2727
static const CAmount PRIVATESEND_ENTRY_MAX_SIZE = 9;
2828

0 commit comments

Comments
 (0)