3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-07 06:44:16 +00:00

When broadcasting a spend, wait for the tx message to actually hit the wire before proceeding.

This resolves an issue where wallet-tool would shut down before the message was actually sent.
This commit is contained in:
Mike Hearn 2013-01-20 23:47:32 +01:00
parent 6504296b79
commit caa92985e1
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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;