mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-11-01 21:17:13 +00:00
Fix SendRequest package in forwarding.js.
This commit is contained in:
committed by
Andreas Schildbach
parent
9e72e72ef4
commit
1fd8b90f42
@@ -48,11 +48,11 @@ var listener = Java.extend(bcj.wallet.listeners.AbstractWalletEventListener);
|
|||||||
wallet.addEventListener(new listener() {
|
wallet.addEventListener(new listener() {
|
||||||
onCoinsReceived: function(wallet, tx, prevBalance, newBalance) {
|
onCoinsReceived: function(wallet, tx, prevBalance, newBalance) {
|
||||||
print("Received money! " + newBalance.toFriendlyString());
|
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);
|
var sendResult = wallet.sendCoins(sendReq);
|
||||||
print("Sending back in tx " + sendResult.tx.hash);
|
print("Sending back in tx " + sendResult.tx.hash);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
print("Press Ctrl-C to stop");
|
print("Press Ctrl-C to stop");
|
||||||
java.lang.Thread.sleep(1000 * 60 * 60); // One hour.
|
java.lang.Thread.sleep(1000 * 60 * 60); // One hour.
|
||||||
|
|||||||
Reference in New Issue
Block a user