use of io.nuls.kernel.model.Result in project nuls by nuls-io.
the class AccountServiceImpl method removeMultiSigAccount.
/**
* 从数据库中删除该账户
*/
@Override
public Result<Boolean> removeMultiSigAccount(String address) {
try {
Address addressObj = Address.fromHashs(address);
Result result = this.multiSigAccountStorageService.getAccount(addressObj);
if (result.isFailed() || result.getData() == null) {
return Result.getFailed(AccountErrorCode.ACCOUNT_NOT_EXIST);
}
return this.multiSigAccountStorageService.removeAccount(addressObj);
} catch (Exception e) {
Log.error(e);
return Result.getFailed();
}
}
use of io.nuls.kernel.model.Result in project nuls by nuls-io.
the class GetBlocksByHashHandler method sendBlock.
private void sendBlock(Block block, Node fromNode) {
BlockMessage blockMessage = new BlockMessage();
blockMessage.setMsgBody(block);
Result result = this.messageBusService.sendToNode(blockMessage, fromNode, true);
if (result.isFailed()) {
Log.warn("send block failed:" + fromNode.getId() + ",height:" + block.getHeader().getHeight());
}
}
use of io.nuls.kernel.model.Result in project nuls by nuls-io.
the class GetBlocksHashHandler method sendResponse.
private void sendResponse(BlockHashResponse response, Node fromNode) {
BlocksHashMessage event = new BlocksHashMessage();
event.setMsgBody(response);
Result result = messageBusService.sendToNode(event, fromNode, true);
if (result.isFailed()) {
BlockLog.debug("send block hashes to " + fromNode.getId() + " failed!");
}
}
use of io.nuls.kernel.model.Result in project nuls by nuls-io.
the class GetBlockHandler method sendBlock.
private void sendBlock(Block block, Node fromNode) {
BlockMessage blockMessage = new BlockMessage();
blockMessage.setMsgBody(block);
Result result = this.messageBusService.sendToNode(blockMessage, fromNode, true);
if (result.isFailed()) {
Log.warn("send block failed:" + fromNode.getId() + ",height:" + block.getHeader().getHeight());
}
}
use of io.nuls.kernel.model.Result in project nuls by nuls-io.
the class GetBlocksByHeightHandler method sendBlock.
private void sendBlock(Block block, Node fromNode) {
BlockMessage blockMessage = new BlockMessage();
blockMessage.setMsgBody(block);
Result result = this.messageBusService.sendToNode(blockMessage, fromNode, true);
if (result.isFailed()) {
Log.warn("send block failed:" + fromNode.getId() + ",height:" + block.getHeader().getHeight());
}
}
Aggregations