Skip to content

Commit

Permalink
Merge pull request #100 from leo42/CoinSelect
Browse files Browse the repository at this point in the history
fix coinselect
  • Loading branch information
leo42 authored Dec 30, 2024
2 parents ec0c04f + 533fa03 commit dd46539
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Fe/src/components/Multisig/multisigWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,16 @@ class Wallet {
if (remainingCoin[key] <= 0n){
delete remainingCoin[key]
}

}
utxos.splice(0, 1)
if (Object.keys(remainingCoin).length === 0){
break

}
utxos.splice(0, 1)
if (Object.keys(remainingCoin).length === 0){
break
}
if (utxos.length === 0){
throw new Error("Not enough coins")
}
}

}
return selectedUtxos;
Expand Down
2 changes: 1 addition & 1 deletion Fe/src/components/WalletCreateTx.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class WalletCreateTx extends React.Component {
{!this.state.tokenData[item].isNft && <div className='tokenAmount'> <input
type="number"
name="amount"
value={ this.state.recipients[index].amount[item] === 0n ? "" : (this.state.tokenData[item] && this.state.tokenData[item].decimals ) ? this.state.recipients[index].amount[item] / (10**this.state.tokenData[item].decimals) : this.state.recipients[index].amount[item] }
value={ this.state.recipients[index].amount[item] === 0n ? "" : (Number(this.state.tokenData[item] && this.state.tokenData[item].decimals ) ? Number(this.state.recipients[index].amount[item]) / Number(10**this.state.tokenData[item].decimals) : Number(this.state.recipients[index].amount[item]) ) }
onChange={event => this.setAmount(event.target.value,item,index)}
/>
<button type="submit" className='maxButton' onClick={ () => this.setMax(item,index)}>max</button>
Expand Down

0 comments on commit dd46539

Please sign in to comment.