Ignore chain sync verification and relaying when -testnode=1
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
#include <wolfssl/ssl.h>
|
||||
#include <hush/tlsmanager.cpp>
|
||||
using namespace hush;
|
||||
extern int32_t HUSH_TESTNODE;
|
||||
|
||||
// Dump addresses to peers.dat every 5 minutes (300s)
|
||||
// Satoshi originally used 10 seconds(!), did they know something Peter Wuille didn't?
|
||||
@@ -2120,7 +2121,12 @@ void RelayTransaction(const CTransaction& tx, const CDataStream& ss)
|
||||
random_shuffle( vRelayNodes.begin(), vRelayNodes.end(), GetRandInt );
|
||||
|
||||
vRelayNodes.resize(newSize);
|
||||
fprintf(stderr, "%s: Relaying to %lu of %lu peers\n", __func__, newSize, vNodes.size() );
|
||||
if (HUSH_TESTNODE==1 && vNodes.size() == 0) {
|
||||
fprintf(stderr, "%s: -testnode=1, no peers, not relaying\n", __func__ );
|
||||
return;
|
||||
} else {
|
||||
fprintf(stderr, "%s: Relaying to %lu of %lu peers\n", __func__, newSize, vNodes.size() );
|
||||
}
|
||||
|
||||
// Only relay to randomly chosen 50% of peers
|
||||
BOOST_FOREACH(CNode* pnode, vRelayNodes)
|
||||
|
||||
@@ -83,7 +83,7 @@ UniValue z_getoperationstatus_IMPL(const UniValue&, bool);
|
||||
|
||||
#define PLAN_NAME_MAX 8
|
||||
#define VALID_PLAN_NAME(x) (strlen(x) <= PLAN_NAME_MAX)
|
||||
#define THROW_IF_SYNCING(INSYNC) if (INSYNC == 0) { throw runtime_error(strprintf("%s: Extreme Privacy! Chain still syncing at height %d, aborting to prevent linkability analysis. Please wait until FULLY SYNCED and try again.",__FUNCTION__,chainActive.Tip()->GetHeight())); }
|
||||
#define THROW_IF_SYNCING(INSYNC) if (HUSH_TESTNODE == 0 && INSYNC == 0) { throw runtime_error(strprintf("%s: Extreme Privacy! Chain still syncing at height %d, aborting to prevent linkability analysis. Please wait until FULLY SYNCED and try again.",__FUNCTION__,chainActive.Tip()->GetHeight())); }
|
||||
|
||||
int tx_height( const uint256 &hash );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user