MCPcopy Create free account
hub / github.com/LUX-Core/lux / AcceptableInputs

Function AcceptableInputs

src/main.cpp:1472–1772  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1470}
1471
1472bool AcceptableInputs(CTxMemPool& pool, CValidationState& state, const CTransaction& tx, bool fLimitFree, bool* pfMissingInputs, bool fRejectInsaneFee, bool isDSTX)
1473{
1474 AssertLockHeld(cs_main);
1475 if (pfMissingInputs)
1476 *pfMissingInputs = false;
1477
1478 if (!CheckTransaction(tx, state))
1479 return false;
1480
1481 // Coinbase is only valid in a block, not as a loose transaction
1482 if (tx.IsCoinBase())
1483 return state.DoS(100, false, REJECT_INVALID, "coinbase");
1484
1485
1486 // Rather not work on nonstandard transactions (unless -testnet/-regtest)
1487 string reason;
1488 // for any real tx this will be checked on AcceptToMemoryPool anyway
1489 // if (Params().RequireStandard() && !IsStandardTx(tx, reason))
1490 // return state.DoS(0,
1491 // error("AcceptableInputs : nonstandard transaction: %s", reason),
1492 // REJECT_NONSTANDARD, reason);
1493
1494 // is it already in the memory pool?
1495 uint256 hash = tx.GetHash();
1496 if (pool.exists(hash))
1497 return false;
1498
1499 // ----------- INSTANTX transaction scanning -----------
1500
1501 for (const CTxIn& in : tx.vin) {
1502 if (mapLockedInputs.count(in.prevout)) {
1503 if (mapLockedInputs[in.prevout] != tx.GetHash()) {
1504 return state.DoS(0,
1505 error("AcceptableInputs : conflicts with existing transaction lock: %s", reason),
1506 REJECT_INVALID, "tx-lock-conflict");
1507 }
1508 }
1509 }
1510
1511 // Check for conflicts with in-memory transactions
1512 {
1513 LOCK(pool.cs); // protect pool.mapNextTx
1514 for (unsigned int i = 0; i < tx.vin.size(); i++) {
1515 COutPoint outpoint = tx.vin[i].prevout;
1516 if (pool.mapNextTx.count(outpoint)) {
1517 // Disable replacement feature for now
1518 return false;
1519 }
1520 }
1521 }
1522
1523
1524 {
1525 CCoinsView dummy;
1526 CCoinsViewCache view(&dummy);
1527
1528 CAmount nValueIn = 0;
1529 LockPoints lp;

Callers 5

ProcessMessageDarksendFunction · 0.85
IsCollateralValidMethod · 0.85
ProcessMasternodeFunction · 0.85
GetMasternodeRankFunction · 0.85

Calls 15

errorFunction · 0.85
CheckSequenceLocksFunction · 0.85
GetTransactionSigOpCostFunction · 0.85
CheckSenderScriptFunction · 0.85
GetArgFunction · 0.85
CheckMinGasPriceFunction · 0.85
MakeTransactionRefFunction · 0.85
GetTimeFunction · 0.85
GetMinRelayFeeFunction · 0.85
GetBoolArgFunction · 0.85
AllowFreeFunction · 0.85
LogPrintFunction · 0.85

Tested by

no test coverage detected