Last active
May 15, 2016 00:38
-
-
Save bumi/6d58f86e2c88a89bc79107f6e741690a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Coin recipientAmount = (total wallet amount) - fees needed / this.recipients.length // if not dividable the rest should be ignored and go to the miners. I don't want change | |
// create a new transactions with the NetworkParameters | |
Transaction sendTx = new Transaction(params); | |
// add the outputs | |
for(String address : this.recipients){ | |
sendTx.addOutput(recipientAmount, Address.fromBase58(params, address)); | |
} | |
// create a SendRequest | |
SendRequest req = SendRequest.forTx(sendTx); | |
// let the wallet take care of completing and broadcasting the transaction | |
Wallet.SendResult result = wallet.sendCoins(req); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment