[问题] ethereumj sync thread

楼主: pttuserboy (pttuserboy)   2016-10-12 18:27:25
https://github.com/ethereum/ethereumj
请问有人在看这个嘛
这是一个类似比特币的东西
我现在在看这一个sample
SendTransaction.java
https://goo.gl/Os9Jf6
它可以sync blockchain
sync完整之后可以SendTransaction
我现在遇到的问题是
我想把这个包成一个function
但是他在SendTransaction
之后不会停止
应该是有一个thread会继续sync blockchain
我想知道如果我想他在SendTransaction
之后停止sync blockchain的thread该怎做呢
BasicSample.java
https://goo.gl/t35j0c
目前我看到这个
public void run() {
try {
logger.info("Sample worker thread started.");
waitForAvailablePeers();
waitForSyncPeers();
waitForFirstBlock();
waitForSync();
onSyncDone();
//我希望他在这边结束
} catch (Exception e) {
logger.error("Error occurred in Sample: ", e);
}
}

Links booklink

Contact Us: admin [ a t ] ucptt.com