diff --git a/src/net.cpp b/src/net.cpp index ae61ea51b..ef029025b 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -43,6 +43,7 @@ #include #include 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) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index e3f5e5064..c1755cf07 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -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 );