@ -270,6 +270,7 @@ function SendFunds(
wallet _ _public _keys . spend ,
wallet _ _private _keys . spend ,
mixin ,
sweeping ,
function (
err ,
unspentOuts ,
@ -340,7 +341,8 @@ function SendFunds(
const usableOutputsAndAmounts = _outputsAndAmountToUseForMixin (
totalAmountIncludingFees ,
unusedOuts ,
isRingCT
isRingCT ,
sweeping
)
// v-- now if RingCT compute fee as closely as possible before hand
var usingOuts = usableOutputsAndAmounts . usingOuts
@ -663,9 +665,9 @@ function _popAndReturnRandomElementFromList(list)
function _outputsAndAmountToUseForMixin (
target _amount ,
unusedOuts ,
isRingCT
)
{
isRingCT ,
sweeping
) {
console . log ( "Selecting outputs to use. target: " + monero _utils . formatMoney ( target _amount ) )
var toFinalize _usingOutsAmount = new JSBigInt ( 0 )
const toFinalize _usingOuts = [ ]
@ -675,10 +677,22 @@ function _outputsAndAmountToUseForMixin(
if ( ! isRingCT && out . rct ) { // out.rct is set by the server
continue ; // skip rct outputs if not creating rct tx
}
const out _amount = out . amount
const out _amount _JSBigInt = new JSBigInt ( out . amount )
if ( out _amount _JSBigInt . compare ( monero _config . dustThreshold ) < 0 ) { // amount is dusty..
if ( sweeping == false ) {
console . log ( "Not sweeping, and found a dusty (though maybe mixable) output... skipping it!" )
continue
}
if ( ! out . rct || typeof out . rct === 'undefined' ) {
console . log ( "Sweeping, and found a dusty but unmixable (non-rct) output... skipping it!" )
continue
} else {
console . log ( "Sweeping and found a dusty but mixable (rct) amount... keeping it!" )
}
}
toFinalize _usingOuts . push ( out )
toFinalize _usingOutsAmount = toFinalize _usingOutsAmount . add ( out _amount )
console . log ( "Using output: " + monero _utils . formatMoney ( out _amount ) + " - " + JSON . stringify ( out ) )
toFinalize _usingOutsAmount = toFinalize _usingOutsAmount . add ( out _amount _JSBigInt )
console . log ( "Using output: " + monero _utils . formatMoney ( out _amount _JSBigInt ) + " - " + JSON . stringify ( out ) )
}
return {
usingOuts : toFinalize _usingOuts ,