forked from Qortal/qortal
catbref
469bf2a63e
Improve inbound peer handshaking
If a node accepts a connection from an inbound peer then remote peer will send RESPONSE first and local node would previously change handshaking state to COMPLETED while computing their own RESPONSE. This meant that the local node would sometimes also start sending post-handshake messages to the remote peer, e.g. TRANSACTION_SIGNATURES. Remote peer is only expecting a RESPONSE message, so would close connection. So we introduce an extra handshaking state "RESPONDING" for use by local node while they compute RESPONSE in a separate thread. Once the RESPONSE has been sent, local node moves to COMPLETED state and called onHandshakeCompleted() as per usual. Note that the code path when connecting outbound to a remote peer is not changed, and the RESPONDING state is not used. Also in this commit: Network.onPeerReady now bypasses call to onMessage and instead calls onHandshakingMessage() directly to avoid race condition where peer's handshake status could change between onPeerReady's caller and onMessage() calling peer.getHandshakeStatus()
Qortal Project - Official Repo
Build / run
- Requires Java 11. OpenJDK 11 recommended over Java SE.
- Install Maven
- Use Maven to fetch dependencies and build:
mvn clean package
- Built JAR should be something like
target/qortal-1.0.jar
- Create basic settings.json file:
echo '{}' > settings.json
- Run JAR in same working directory as settings.json:
java -jar target/qortal-1.0.jar
- Wrap in shell script, add JVM flags, redirection, backgrounding, etc. as necessary.
- Or use supplied example shell script: run.sh
Description
Qortal Core - Main Code Repository
Decentralized Data Network - Blockchain - TRUE Cross-Chain Trading - Application and Website Hosting - Much More - Qortal is the future internet infrastructure for the global digital world.
Languages
Java
98%
JavaScript
0.6%
Shell
0.5%
HTML
0.5%
Perl
0.3%