Skip to content

Commit 0fbfd9b

Browse files
committed
privatesend: Make sure change in MakeCollateralAmounts has min value
1 parent a566eaf commit 0fbfd9b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/privatesend/privatesend-client.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,6 +1498,11 @@ bool CPrivateSendClientSession::MakeCollateralAmounts(const CompactTallyItem& ta
14981498
}
14991499
}
15001500

1501+
if(wtx.tx->vout[nChangePosRet].nValue < CPrivateSend::GetCollateralAmount()) {
1502+
LogPrint(BCLog::PRIVATESEND, "CPrivateSendClientSession::MakeCollateralAmounts -- Not enough change in tx: %s\n", wtx.tx->ToString());
1503+
return false;
1504+
}
1505+
15011506
reservekeyCollateral.KeepKey();
15021507

15031508
LogPrint(BCLog::PRIVATESEND, "CPrivateSendClientSession::MakeCollateralAmounts -- txid=%s\n", wtx.GetHash().GetHex());

0 commit comments

Comments
 (0)