use of io.nuls.db.dao.UtxoOutputDataService in project nuls by nuls-io.
the class UtxoInput method parse.
@Override
public void parse(NulsByteBuffer byteBuffer) throws NulsException {
index = (int) byteBuffer.readVarInt();
fromHash = byteBuffer.readNulsData(new NulsDigestData());
fromIndex = (int) byteBuffer.readVarInt();
LedgerCacheService ledgerCacheService = LedgerCacheService.getInstance();
UtxoOutput output = ledgerCacheService.getUtxo(this.getKey());
if (output == null) {
UtxoOutputDataService utxoOutputDataService = NulsContext.getServiceBean(UtxoOutputDataService.class);
Map<String, Object> map = new HashMap<>();
map.put("txHash", this.fromHash.getDigestHex());
map.put("outIndex", this.fromIndex);
UtxoOutputPo outputPo = utxoOutputDataService.get(map);
if (outputPo != null) {
output = UtxoTransferTool.toOutput(outputPo);
}
}
from = output;
}
use of io.nuls.db.dao.UtxoOutputDataService in project nuls by nuls-io.
the class UtxoLedgerModuleBootstrap method init.
@Override
public void init() {
EventManager.putEvent(BalanceChangeNotice.class);
registerService();
ledgerService = NulsContext.getServiceBean(LedgerService.class);
UtxoOutputDataService outputDataService = NulsContext.getServiceBean(UtxoOutputDataService.class);
coinManager = UtxoCoinManager.getInstance();
coinManager.setOutputDataService(outputDataService);
cacheService = LedgerCacheService.getInstance();
addNormalTxValidator();
}
Aggregations