diff --git a/core/src/main/java/com/google/bitcoin/core/Peer.java b/core/src/main/java/com/google/bitcoin/core/Peer.java index 9d397373..3f9cd185 100644 --- a/core/src/main/java/com/google/bitcoin/core/Peer.java +++ b/core/src/main/java/com/google/bitcoin/core/Peer.java @@ -605,8 +605,8 @@ public class Peer { /** * Sends the given message on the peers Channel. */ - public void sendMessage(Message m) throws IOException { - Channels.write(channel, m); + public ChannelFuture sendMessage(Message m) throws IOException { + return Channels.write(channel, m); } // Keep track of the last request we made to the peer in blockChainDownload so we can avoid redundant and harmful diff --git a/core/src/main/java/com/google/bitcoin/core/PeerGroup.java b/core/src/main/java/com/google/bitcoin/core/PeerGroup.java index 33c4bbaa..ab17db1a 100644 --- a/core/src/main/java/com/google/bitcoin/core/PeerGroup.java +++ b/core/src/main/java/com/google/bitcoin/core/PeerGroup.java @@ -968,7 +968,7 @@ public class PeerGroup extends AbstractIdleService { // transaction or not. However, we are not a fully validating node and this is advertised in // our version message, as SPV nodes cannot relay it doesn't give away any additional information // to skip the inv here - we wouldn't send invs anyway. - somePeer.sendMessage(pinnedTx); + somePeer.sendMessage(pinnedTx).awaitUninterruptibly(); } catch (IOException e) { future.setException(e); return;