Commit 9c2c86ce authored by Giuseppe Raveduto's avatar Giuseppe Raveduto Committed by Andreas Schildbach

Fix SendRequest package in forwarding.js.

parent 92b9fdc7
......@@ -32,11 +32,11 @@ var listener = Java.extend(bcj.wallet.listeners.AbstractWalletEventListener);
wallet.addEventListener(new listener() {
onCoinsReceived: function(wallet, tx, prevBalance, newBalance) {
print("Received money! " + newBalance.toFriendlyString());
var sendReq = bcj.core.Wallet.SendRequest.emptyWallet(forwardingAddr);
var sendReq = bcj.wallet.SendRequest.emptyWallet(forwardingAddr);
var sendResult = wallet.sendCoins(sendReq);
print("Sending back in tx " + sendResult.tx.hash);
}
});
print("Press Ctrl-C to stop");
java.lang.Thread.sleep(1000 * 60 * 60); // One hour.
\ No newline at end of file
java.lang.Thread.sleep(1000 * 60 * 60); // One hour.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment