mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-12 21:54:31 +00:00
revert and modify tx size calc for two outputs
This commit is contained in:
parent
6a07672437
commit
72cb62774c
1 changed files with 4 additions and 5 deletions
|
@ -1,6 +1,7 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:bech32/bech32.dart';
|
import 'package:bech32/bech32.dart';
|
||||||
import 'package:bip32/bip32.dart' as bip32;
|
import 'package:bip32/bip32.dart' as bip32;
|
||||||
|
@ -2387,11 +2388,9 @@ class BitcoinWallet extends CoinServiceAPI
|
||||||
],
|
],
|
||||||
satoshiAmounts: [
|
satoshiAmounts: [
|
||||||
satoshiAmountToSend,
|
satoshiAmountToSend,
|
||||||
// this can cause a problem where the output value is negative so commenting out for now
|
// should/can we just set this to 0 ?
|
||||||
// satoshisBeingUsed - satoshiAmountToSend - 1
|
max(0, satoshisBeingUsed - satoshiAmountToSend - 1),
|
||||||
// and using dust limit instead
|
],
|
||||||
DUST_LIMIT,
|
|
||||||
], // dust limit is the minimum amount a change output should be
|
|
||||||
))["vSize"] as int;
|
))["vSize"] as int;
|
||||||
|
|
||||||
// Assume 1 output, only for recipient and no change
|
// Assume 1 output, only for recipient and no change
|
||||||
|
|
Loading…
Reference in a new issue