mirror of
https://github.com/dashpay/dash.git
synced 2024-12-28 05:23:01 +01:00
add transaction scanning for new transactions
This commit is contained in:
parent
e3ef585263
commit
d4896934e1
@ -103,7 +103,6 @@ void ProcessMessageInstantX(CNode* pfrom, std::string& strCommand, CDataStream&
|
|||||||
if((*i).second.CountSignatures() >= INSTANTX_SIGNATURES_REQUIRED){
|
if((*i).second.CountSignatures() >= INSTANTX_SIGNATURES_REQUIRED){
|
||||||
LogPrintf("ProcessMessageInstantX::txlreq - Found Existing Complete IX Lock\n");
|
LogPrintf("ProcessMessageInstantX::txlreq - Found Existing Complete IX Lock\n");
|
||||||
|
|
||||||
uint256 txHash = (*i).second.txHash;
|
|
||||||
CValidationState state;
|
CValidationState state;
|
||||||
bool fMissingInputs = false;
|
bool fMissingInputs = false;
|
||||||
DisconnectBlockAndInputs(state, tx);
|
DisconnectBlockAndInputs(state, tx);
|
||||||
|
30
src/main.cpp
30
src/main.cpp
@ -908,6 +908,30 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ----------- instantX transaction scanning -----------
|
||||||
|
|
||||||
|
std::map<uint256, CTransactionLock>::iterator it = mapTxLocks.begin();
|
||||||
|
|
||||||
|
while(it != mapTxLocks.end()) {
|
||||||
|
if(mapTxLockReq.count((*it).second.txHash)){
|
||||||
|
CTransaction& tx2 = mapTxLockReq[(*it).second.txHash];
|
||||||
|
for (unsigned int a = 0; a < tx2.vin.size(); a++) {
|
||||||
|
//we found the locked tx in the block
|
||||||
|
if(tx2.GetHash() == tx.GetHash()) continue;
|
||||||
|
|
||||||
|
//if there's a lock, look for conflicting inputs
|
||||||
|
for (unsigned int b = 0; b < tx.vin.size(); b++) {
|
||||||
|
if(tx2.vin[a].prevout == tx.vin[b].prevout) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
it++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
CCoinsView dummy;
|
CCoinsView dummy;
|
||||||
CCoinsViewCache view(dummy);
|
CCoinsViewCache view(dummy);
|
||||||
@ -2903,11 +2927,9 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo
|
|||||||
for (unsigned int a = 0; a < tx.vin.size(); a++) {
|
for (unsigned int a = 0; a < tx.vin.size(); a++) {
|
||||||
for (unsigned int b = 0; b < block.vtx.size(); b++) {
|
for (unsigned int b = 0; b < block.vtx.size(); b++) {
|
||||||
//we found the locked tx in the block
|
//we found the locked tx in the block
|
||||||
if(tx.GetHash() == block.vtx[b].GetHash()) {
|
if(tx.GetHash() == block.vtx[b].GetHash()) continue;
|
||||||
printf("CheckBlock -- found locked transaction\n");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
//if there's a lock, look for conflicting inputs
|
||||||
for (unsigned int c = 0; c < block.vtx[b].vin.size(); c++) {
|
for (unsigned int c = 0; c < block.vtx[b].vin.size(); c++) {
|
||||||
if(tx.vin[a].prevout == block.vtx[b].vin[c].prevout) {
|
if(tx.vin[a].prevout == block.vtx[b].vin[c].prevout) {
|
||||||
return state.DoS(100, error("CheckBlock() : found conflicting transaction with transaction lock"),
|
return state.DoS(100, error("CheckBlock() : found conflicting transaction with transaction lock"),
|
||||||
|
Loading…
Reference in New Issue
Block a user