diff --git a/api/types.go b/api/types.go index 8bf1cd4b..4047c3b1 100644 --- a/api/types.go +++ b/api/types.go @@ -265,6 +265,7 @@ type Utxo struct { Confirmations int `json:"confirmations"` Address string `json:"address,omitempty"` Path string `json:"path,omitempty"` + Locktime uint32 `json:"lockTime,omitempty"` } // Utxos is array of Utxo diff --git a/configs/coins/bitcoin_testnet.json b/configs/coins/bitcoin_testnet.json index 5e72c74d..f892a6a1 100644 --- a/configs/coins/bitcoin_testnet.json +++ b/configs/coins/bitcoin_testnet.json @@ -59,10 +59,7 @@ "xpub_magic_segwit_p2sh": 71979618, "xpub_magic_segwit_native": 73342198, "slip44": 1, - "additional_params": { - "alternativeEstimateFee": "whatthefee", - "alternativeEstimateFeeParams": "{\"url\": \"https://whatthefee.io/data.json\", \"periodSeconds\": 60}" - } + "additional_params": {} } }, "meta": { diff --git a/db/rocksdb.go b/db/rocksdb.go index 735402e3..3c1e65f4 100644 --- a/db/rocksdb.go +++ b/db/rocksdb.go @@ -19,7 +19,7 @@ import ( "github.com/tecbot/gorocksdb" ) -const dbVersion = 4 +const dbVersion = 5 const packedHeightBytes = 4 const maxAddrDescLen = 1024 @@ -383,11 +383,20 @@ type TxAddresses struct { Outputs []TxOutput } +// Utxo holds information about unspent transaction output +type Utxo struct { + BtxID []byte + Vout int32 + Height uint32 + ValueSat big.Int +} + // AddrBalance stores number of transactions and balances of an address type AddrBalance struct { Txs uint32 SentSat big.Int BalanceSat big.Int + Utxos []Utxo } // ReceivedSat computes received amount from total balance and sent amount @@ -422,7 +431,7 @@ func (d *RocksDB) GetAndResetConnectBlockStats() string { func (d *RocksDB) processAddressesBitcoinType(block *bchain.Block, addresses addressesMap, txAddressesMap map[string]*TxAddresses, balances map[string]*AddrBalance) error { blockTxIDs := make([][]byte, len(block.Txs)) blockTxAddresses := make([]*TxAddresses, len(block.Txs)) - // first process all outputs so that inputs can point to txs in this block + // first process all outputs so that inputs can refer to txs in this block for txi := range block.Txs { tx := &block.Txs[txi] btxID, err := d.chainParser.PackTxid(tx.Txid)