mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
Accept non-spent LLMQ IS locked outpoints from mempool in PS mixing (#2878)
This commit is contained in:
parent
2652030a2b
commit
7f419ae7fc
@ -18,6 +18,8 @@
|
||||
#include "utilmoneystr.h"
|
||||
#include "validation.h"
|
||||
|
||||
#include "llmq/quorums_instantsend.h"
|
||||
|
||||
CPrivateSendServer privateSendServer;
|
||||
|
||||
void CPrivateSendServer::ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStream& vRecv, CConnman& connman)
|
||||
@ -217,7 +219,15 @@ void CPrivateSendServer::ProcessMessage(CNode* pfrom, const std::string& strComm
|
||||
LogPrint("privatesend", "DSVIN -- txin=%s\n", txin.ToString());
|
||||
|
||||
Coin coin;
|
||||
if (GetUTXOCoin(txin.prevout, coin)) {
|
||||
auto mempoolTx = mempool.get(txin.prevout.hash);
|
||||
if (mempoolTx != nullptr) {
|
||||
if (mempool.isSpent(txin.prevout) || !llmq::quorumInstantSendManager->IsLocked(txin.prevout.hash)) {
|
||||
LogPrintf("DSVIN -- spent or non-locked mempool input! txin=%s\n", txin.ToString());
|
||||
PushStatus(pfrom, STATUS_REJECTED, ERR_MISSING_TX, connman);
|
||||
return;
|
||||
}
|
||||
nValueIn += mempoolTx->vout[txin.prevout.n].nValue;
|
||||
} else if (GetUTXOCoin(txin.prevout, coin)) {
|
||||
nValueIn += coin.out.nValue;
|
||||
} else {
|
||||
LogPrintf("DSVIN -- missing input! txin=%s\n", txin.ToString());
|
||||
|
@ -16,6 +16,8 @@
|
||||
#include "utilmoneystr.h"
|
||||
#include "validation.h"
|
||||
|
||||
#include "llmq/quorums_instantsend.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
bool CPrivateSendEntry::AddScriptSig(const CTxIn& txin)
|
||||
@ -238,11 +240,19 @@ bool CPrivateSend::IsCollateralValid(const CTransaction& txCollateral)
|
||||
|
||||
for (const auto& txin : txCollateral.vin) {
|
||||
Coin coin;
|
||||
if (!GetUTXOCoin(txin.prevout, coin)) {
|
||||
auto mempoolTx = mempool.get(txin.prevout.hash);
|
||||
if (mempoolTx != nullptr) {
|
||||
if (mempool.isSpent(txin.prevout) || !llmq::quorumInstantSendManager->IsLocked(txin.prevout.hash)) {
|
||||
LogPrint("privatesend", "CPrivateSend::IsCollateralValid -- spent or non-locked mempool input! txin=%s\n", txin.ToString());
|
||||
return false;
|
||||
}
|
||||
nValueIn += mempoolTx->vout[txin.prevout.n].nValue;
|
||||
} else if (GetUTXOCoin(txin.prevout, coin)) {
|
||||
nValueIn += coin.out.nValue;
|
||||
} else {
|
||||
LogPrint("privatesend", "CPrivateSend::IsCollateralValid -- Unknown inputs in collateral transaction, txCollateral=%s", txCollateral.ToString());
|
||||
return false;
|
||||
}
|
||||
nValueIn += coin.out.nValue;
|
||||
}
|
||||
|
||||
//collateral transactions are required to pay out a small fee to the miners
|
||||
|
Loading…
Reference in New Issue
Block a user