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

Fix minor bug in PingService.

This commit is contained in:
Mike Hearn 2012-10-08 14:36:35 +02:00
parent b4215e8b01
commit 74042b8ca3

View File

@ -19,7 +19,6 @@ package com.google.bitcoin.examples;
import com.google.bitcoin.core.*; import com.google.bitcoin.core.*;
import com.google.bitcoin.discovery.DnsDiscovery; import com.google.bitcoin.discovery.DnsDiscovery;
import com.google.bitcoin.store.BlockStore; import com.google.bitcoin.store.BlockStore;
import com.google.bitcoin.store.BlockStoreException;
import com.google.bitcoin.store.BoundedOverheadBlockStore; import com.google.bitcoin.store.BoundedOverheadBlockStore;
import com.google.bitcoin.utils.BriefLogFormatter; import com.google.bitcoin.utils.BriefLogFormatter;
@ -189,9 +188,9 @@ public class PingService {
Address from = input.getFromAddress(); Address from = input.getFromAddress();
System.out.println("Received " + Utils.bitcoinValueToFriendlyString(value) + " from " + from.toString()); System.out.println("Received " + Utils.bitcoinValueToFriendlyString(value) + " from " + from.toString());
// Now send the coins back! // Now send the coins back!
Transaction sendTx = w.sendCoins(peerGroup, from, value).tx; Wallet.SendResult sendResult = w.sendCoins(peerGroup, from, value);
assert sendTx != null; // We should never try to send more coins than we have! assert sendResult != null; // We should never try to send more coins than we have!
System.out.println("Sent coins back! Transaction hash is " + sendTx.getHashAsString()); System.out.println("Sent coins back! Transaction hash is " + sendResult.tx.getHashAsString());
w.saveToFile(walletFile); w.saveToFile(walletFile);
} catch (ScriptException e) { } catch (ScriptException e) {
// If we didn't understand the scriptSig, just crash. // If we didn't understand the scriptSig, just crash.