mirror of
https://git.hush.is/hush/hush3.git
synced 2025-07-21 00:02:09 -04:00
Compare commits
No commits in common. "fb5563d06adddb491990c7e7c6de6dd71f1305d8" and "963ce1e444bcb9d8a4ab43179c2a70c251f07193" have entirely different histories.
fb5563d06a
...
963ce1e444
@ -29,8 +29,6 @@ static const unsigned char REJECT_MALFORMED = 0x01;
|
|||||||
static const unsigned char REJECT_INVALID = 0x10;
|
static const unsigned char REJECT_INVALID = 0x10;
|
||||||
static const unsigned char REJECT_OBSOLETE = 0x11;
|
static const unsigned char REJECT_OBSOLETE = 0x11;
|
||||||
static const unsigned char REJECT_DUPLICATE = 0x12;
|
static const unsigned char REJECT_DUPLICATE = 0x12;
|
||||||
static const unsigned char REJECT_DUPLICATE_OUTPUT_PROOF = 0x13;
|
|
||||||
static const unsigned char REJECT_DUPLICATE_SPEND_PROOF = 0x14;
|
|
||||||
static const unsigned char REJECT_NONSTANDARD = 0x40;
|
static const unsigned char REJECT_NONSTANDARD = 0x40;
|
||||||
static const unsigned char REJECT_DUST = 0x41;
|
static const unsigned char REJECT_DUST = 0x41;
|
||||||
static const unsigned char REJECT_INSUFFICIENTFEE = 0x42;
|
static const unsigned char REJECT_INSUFFICIENTFEE = 0x42;
|
||||||
|
26
src/main.cpp
26
src/main.cpp
@ -1751,31 +1751,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
|
|||||||
{
|
{
|
||||||
return error("AcceptToMemoryPool: CheckTransaction failed");
|
return error("AcceptToMemoryPool: CheckTransaction failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reject duplicate output proofs in a single ztx in mempool
|
|
||||||
// Migrate this to CheckTransaction() to make it a consensus requirement
|
|
||||||
{
|
|
||||||
set<libzcash::GrothProof> vSaplingOutputProof;
|
|
||||||
BOOST_FOREACH(const OutputDescription& output, tx.vShieldedOutput)
|
|
||||||
{
|
|
||||||
if (vSaplingOutputProof.count(output.zkproof))
|
|
||||||
return state.Invalid(error("AcceptToMemoryPool: duplicate output proof"),REJECT_DUPLICATE_OUTPUT_PROOF, "bad-txns-duplicate-output-proof");
|
|
||||||
vSaplingOutputProof.insert(output.zkproof);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reject duplicate spend proofs in a single ztx in mempool
|
|
||||||
// Migrate this to CheckTransaction() to make it a consensus requirement
|
|
||||||
{
|
|
||||||
set<libzcash::GrothProof> vSaplingSpendProof;
|
|
||||||
BOOST_FOREACH(const SpendDescription& spend, tx.vShieldedSpend)
|
|
||||||
{
|
|
||||||
if (vSaplingSpendProof.count(spend.zkproof))
|
|
||||||
return state.Invalid(error("AcceptToMemoryPool: duplicate spend proof"),REJECT_DUPLICATE_SPEND_PROOF, "bad-txns-duplicate-spend-proof");
|
|
||||||
vSaplingSpendProof.insert(spend.zkproof);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// DoS level set to 10 to be more forgiving.
|
// DoS level set to 10 to be more forgiving.
|
||||||
// Check transaction contextually against the set of consensus rules which apply in the next block to be mined.
|
// Check transaction contextually against the set of consensus rules which apply in the next block to be mined.
|
||||||
if (!ContextualCheckTransaction(0,0,0,tx, state, nextBlockHeight, (dosLevel == -1) ? 10 : dosLevel))
|
if (!ContextualCheckTransaction(0,0,0,tx, state, nextBlockHeight, (dosLevel == -1) ? 10 : dosLevel))
|
||||||
|
@ -1122,7 +1122,6 @@ void static RandomXMiner()
|
|||||||
int randomxInterval = GetArg("-ac_randomx_interval",1024);
|
int randomxInterval = GetArg("-ac_randomx_interval",1024);
|
||||||
// This lag is 80 mins for 75s blocktime and 64 mins for 60s (default) blocktime for HSCs
|
// This lag is 80 mins for 75s blocktime and 64 mins for 60s (default) blocktime for HSCs
|
||||||
int randomxBlockLag = GetArg("-ac_randomx_lag", 64);
|
int randomxBlockLag = GetArg("-ac_randomx_lag", 64);
|
||||||
randomx_vm *myVM = nullptr;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// fprintf(stderr,"RandomXMiner: mining %s with randomx\n",SMART_CHAIN_SYMBOL);
|
// fprintf(stderr,"RandomXMiner: mining %s with randomx\n",SMART_CHAIN_SYMBOL);
|
||||||
@ -1199,7 +1198,7 @@ void static RandomXMiner()
|
|||||||
// randomx_init_dataset(randomxDataset, randomxCache, 0, datasetItemCount);
|
// randomx_init_dataset(randomxDataset, randomxCache, 0, datasetItemCount);
|
||||||
rxdebug("%s: dataset initialized\n");
|
rxdebug("%s: dataset initialized\n");
|
||||||
|
|
||||||
myVM = randomx_create_vm(flags, nullptr, randomxDataset);
|
randomx_vm *myVM = randomx_create_vm(flags, nullptr, randomxDataset);
|
||||||
if(myVM == NULL) {
|
if(myVM == NULL) {
|
||||||
LogPrintf("RandomXMiner: Cannot create RandomX VM, aborting!\n");
|
LogPrintf("RandomXMiner: Cannot create RandomX VM, aborting!\n");
|
||||||
return;
|
return;
|
||||||
@ -1426,12 +1425,10 @@ void static RandomXMiner()
|
|||||||
miningTimer.stop();
|
miningTimer.stop();
|
||||||
c.disconnect();
|
c.disconnect();
|
||||||
|
|
||||||
randomx_destroy_vm(myVM);
|
|
||||||
LogPrintf("%s: destroyed vm via thread interrupt\n", __func__);
|
|
||||||
randomx_release_dataset(randomxDataset);
|
randomx_release_dataset(randomxDataset);
|
||||||
rxdebug("%s: released dataset via thread interrupt\n");
|
rxdebug("%s: released dataset\n");
|
||||||
randomx_release_cache(randomxCache);
|
randomx_release_cache(randomxCache);
|
||||||
rxdebug("%s: released cache via thread interrupt\n");
|
rxdebug("%s: released cache\n");
|
||||||
|
|
||||||
LogPrintf("HushRandomXMiner terminated\n");
|
LogPrintf("HushRandomXMiner terminated\n");
|
||||||
throw;
|
throw;
|
||||||
@ -1440,20 +1437,18 @@ void static RandomXMiner()
|
|||||||
c.disconnect();
|
c.disconnect();
|
||||||
fprintf(stderr,"RandomXMiner: runtime error: %s\n", e.what());
|
fprintf(stderr,"RandomXMiner: runtime error: %s\n", e.what());
|
||||||
|
|
||||||
randomx_destroy_vm(myVM);
|
|
||||||
LogPrintf("%s: destroyed vm because of error\n", __func__);
|
|
||||||
randomx_release_dataset(randomxDataset);
|
randomx_release_dataset(randomxDataset);
|
||||||
rxdebug("%s: released dataset because of error\n");
|
rxdebug("%s: released dataset\n");
|
||||||
randomx_release_cache(randomxCache);
|
randomx_release_cache(randomxCache);
|
||||||
rxdebug("%s: released cache because of error\n");
|
rxdebug("%s: released cache\n");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
randomx_release_dataset(randomxDataset);
|
randomx_release_dataset(randomxDataset);
|
||||||
rxdebug("%s: released dataset in normal exit\n");
|
rxdebug("%s: released dataset\n");
|
||||||
randomx_release_cache(randomxCache);
|
randomx_release_cache(randomxCache);
|
||||||
rxdebug("%s: released cache in normal exit\n");
|
rxdebug("%s: released cache\n");
|
||||||
miningTimer.stop();
|
miningTimer.stop();
|
||||||
c.disconnect();
|
c.disconnect();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user