Open GoogleCodeExporter opened 9 years ago
This issue's title should have read:
> Wallet.completeTx created transaction with negative fee value
The first line should have read:
> I created a testnet transaction using Wallet.completeTx(...), ...
There's no such thing as "Wallet.createTx". I don't know what I was thinking
(but it *has* been a long day...). ;o)
Original comment by mbogos...@gmail.com
on 25 Mar 2015 at 11:52
Can you show the code that did this? Are you using bitcoinj latest master?
Original comment by andreas....@gmail.com
on 26 Mar 2015 at 9:02
bitcoinj was from the v0.12.2 release. Here's the code snippet:
Transaction createTx(final WalletAppKit kit,
final BigInteger amount,
final ECKey otherPublicKey)
throws InsufficientMoneyException {
final ECKey myKey = kit.wallet().freshReceiveKey();
final Transaction tx = new Transaction(kit.params());
final Script script =
ScriptBuilder.createMultiSigOutputScript(1, ImmutableList.of(myKey, otherPublicKey));
tx.addOutput(amount.longValue()), script);
Wallet.SendRequest sendRequest = Wallet.SendRequest.forTx(tx);
kit.wallet().completeTx(sendRequest);
return tx;
}
Original comment by mbogos...@gmail.com
on 26 Mar 2015 at 1:55
Is that repeatable? I mean if you run the same code with the same wallet do you
get the same transaction out?
The code that is supposed to prevent this is "throw new
InsufficientMoneyException(valueMissing)" in Wallet.java. You could try
stepping through the fee calculation logic to find out how it managed to miss
this line. The fee calculator code is complicated (maybe too complicated - not
sure handling all the edge cases is really worth it), but I don't recall this
problem cropping up before.
Original comment by mh.in.en...@gmail.com
on 27 Mar 2015 at 12:42
Original issue reported on code.google.com by
mbogos...@gmail.com
on 25 Mar 2015 at 11:43Attachments: