3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-01-30 23:02:15 +00:00

NPE when invoking PeerGroup.broadcastTransaction() on peer group with no block chain.

The modified line here seems to have been assuming that `pinnedTx` was being
initialized elsewhere, but it wasn't.
This commit is contained in:
Adam Mackler 2014-12-28 07:17:43 -05:00
parent 1fae7cadc9
commit e77089f739

View File

@ -103,7 +103,7 @@ public class TransactionBroadcast {
List<Peer> peers = peerGroup.getConnectedPeers(); // snapshots
// We intern the tx here so we are using a canonical version of the object (as it's unfortunately mutable).
// TODO: Once confidence state is moved out of Transaction we can kill off this step.
pinnedTx = context != null ? context.getConfidenceTable().intern(tx) : pinnedTx;
pinnedTx = context != null ? context.getConfidenceTable().intern(tx) : tx;
// Prepare to send the transaction by adding a listener that'll be called when confidence changes.
// Only bother with this if we might actually hear back:
if (minConnections > 1)