Search in sources :

Example 6 with BlockTransactionHashIndex

use of com.sparrowwallet.drongo.wallet.BlockTransactionHashIndex in project sparrow by sparrowwallet.

the class BlockTransactionHashIndexMapper method map.

@Override
public BlockTransactionHashIndex map(ResultSet rs, StatementContext ctx) throws SQLException {
    BlockTransactionHashIndex blockTransactionHashIndex = new BlockTransactionHashIndex(Sha256Hash.wrap(rs.getBytes("blockTransactionHashIndex.hash")), rs.getInt("blockTransactionHashIndex.height"), rs.getTimestamp("blockTransactionHashIndex.date"), rs.getLong("blockTransactionHashIndex.fee"), rs.getLong("blockTransactionHashIndex.index"), rs.getLong("blockTransactionHashIndex.outputValue"), null, rs.getString("blockTransactionHashIndex.label"));
    blockTransactionHashIndex.setId(rs.getLong("blockTransactionHashIndex.id"));
    int statusIndex = rs.getInt("blockTransactionHashIndex.status");
    if (!rs.wasNull()) {
        blockTransactionHashIndex.setStatus(Status.values()[statusIndex]);
    }
    return blockTransactionHashIndex;
}
Also used : BlockTransactionHashIndex(com.sparrowwallet.drongo.wallet.BlockTransactionHashIndex)

Example 7 with BlockTransactionHashIndex

use of com.sparrowwallet.drongo.wallet.BlockTransactionHashIndex in project sparrow by sparrowwallet.

the class WalletNodeDao method addTransactionOutputs.

default void addTransactionOutputs(WalletNode addressNode) {
    for (BlockTransactionHashIndex txo : addressNode.getTransactionOutputs()) {
        txo.setId(null);
        if (txo.isSpent()) {
            txo.getSpentBy().setId(null);
        }
        addOrUpdate(addressNode, txo);
    }
}
Also used : BlockTransactionHashIndex(com.sparrowwallet.drongo.wallet.BlockTransactionHashIndex)

Aggregations

BlockTransactionHashIndex (com.sparrowwallet.drongo.wallet.BlockTransactionHashIndex)7 WalletNode (com.sparrowwallet.drongo.wallet.WalletNode)4 KeyPurpose (com.sparrowwallet.drongo.KeyPurpose)2 BlockTransaction (com.sparrowwallet.drongo.wallet.BlockTransaction)2 CahootsContext (com.samourai.soroban.cahoots.CahootsContext)1 OnlineCahootsMessage (com.samourai.soroban.client.cahoots.OnlineCahootsMessage)1 SorobanCahootsService (com.samourai.soroban.client.cahoots.SorobanCahootsService)1 Cahoots (com.samourai.wallet.cahoots.Cahoots)1 HashIndex (com.sparrowwallet.drongo.protocol.HashIndex)1 Transaction (com.sparrowwallet.drongo.protocol.Transaction)1 PSBTParseException (com.sparrowwallet.drongo.psbt.PSBTParseException)1 Wallet (com.sparrowwallet.drongo.wallet.Wallet)1 EventManager (com.sparrowwallet.sparrow.EventManager)1 NewWalletTransactionsEvent (com.sparrowwallet.sparrow.event.NewWalletTransactionsEvent)1 Config (com.sparrowwallet.sparrow.io.Config)1 java.util (java.util)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Collectors (java.util.stream.Collectors)1 LongProperty (javafx.beans.property.LongProperty)1