Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
223880 committed Apr 3, 2024
1 parent f54bab7 commit 0be12b5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/app/bitcoin/CoinCointrol.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as bitcoin from 'bitcoinjs-lib';
import * as UTXO from 'bitcoinjs-lib';

interface UTXO {
txid: string;
Expand All @@ -10,15 +10,17 @@ interface UTXO {

interface Wallet {
utxos: UTXO[];
privateKeys: Record<string, bitcoin.ECPair.ECPairInterface>;
privateKeys: Map<string, bitcoin.ECPair.ECPairInterface>;
}

}

function addUTXO(wallet: Wallet, txid: string, index: number, txout: bitcoin.TxOut, address: bitcoin.Address) {
wallet.utxos.push({ txid, index, txout, address });
wallet.utxos.({ txid, index, txout, address });
}

function removeUTXO(wallet: Wallet, txid: string) {
wallet.utxos = wallet.utxos.filter(utxo => utxo.txid !== txid);
wallet.utxos = wallet.utxos(utxo => utxo.txid !== txid);
}

function selectUTXOs(wallet: Wallet, amount: number): UTXO[] {
Expand Down

0 comments on commit 0be12b5

Please sign in to comment.