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)
|
||||
|
||||
Reference in New Issue
Block a user