@Nullable @Override public Message handleGetDataExtension(InventoryItem item) { if (network.permitsMasternodesLogic()) { final String type = item.type; if (type.equals(DashDefinition.INV_TYPE_TRANSACTION_LOCK_REQUEST)) { if (!network.getSporkManager().isSporkActive(SporkManager.SPORK_2_INSTANTX)) return null; return network.getInstantXManager().getKnownLockRequest(item.hash); } else if (type.equals(DashDefinition.INV_TYPE_TRANSACTION_LOCK_VOTE)) { if (!network.getSporkManager().isSporkActive(SporkManager.SPORK_2_INSTANTX)) return null; return network.getInstantXManager().getKnownConsensusVote(item.hash); } else if (type.equals(DashDefinition.INV_TYPE_SPORK)) { return network.getSporkManager().sporkMessagesRegistry.get(item.hash); } else if (type.equals(DashDefinition.INV_TYPE_MASTERNODE_SCANNING_ERROR)) { return network.getMasternodeManager().getMasternodeScanningErrorsRegistry().get(item.hash); } else if (type.equals(DashDefinition.INV_TYPE_MASTERNODE_ANNOUNCE)) { return network.getMasternodeManager().getMasternodeBroadcastRegistry().get(item.hash); } else if (type.equals(DashDefinition.INV_TYPE_MASTERNODE_PING)) { return network.getMasternodeManager().getMasternodePingRegistry().get(item.hash); } } return null; }
@Nullable @Override public List<Message> getData(Peer peer, GetDataMessage m) { //Log.i("getData", m.toString()); //Log.i("onChainDownloadStarted", peer.toString()); return null; }
@Override public Message getBroadcastMessage() { final DashNetwork dashNetwork = CommonUtils.extractNetworkExtension(tx.getParams()); if (wireStrategy == null || wireStrategy == DashTransactionWireStrategy.STANDARD || !dashNetwork.permitsLockRequestSending() || dashNetwork.isSyncingMasternodeAssets()) { return tx; } // we are about to broadcast lock request if (dashNetwork.permitsInstantX(tx)) { dashNetwork.getInstantXManager().internLockRequest(tx.getHash()); } return new TransactionLockRequest(tx); }
@Override public Message onPreMessageReceived(Peer peer, Message m) { //Log.i("onPreMessageReceived", peer.toString()); return super.onPreMessageReceived(peer, m); }
@Override public Message onPreMessageReceived(Peer peer, Message m) { // Just pass the message right through for further processing. return m; }
@Override public List<Message> getData(Peer peer, GetDataMessage m) { return null; }
@Override public List<Message> getData(Peer peer, GetDataMessage message) { return null; }
@Override public Message onPreMessageReceived(Peer peer, Message message) { return null; }