cleanup and change sewit witness output to its own tx

This commit is contained in:
Ben
2023-07-02 19:22:33 -04:00
parent b147eff49a
commit b1800419c4
13 changed files with 886 additions and 117 deletions
-8
View File
@@ -6,8 +6,6 @@ import { BehaviorSubject, filter } from 'rxjs';
import { IBlockTemplate } from '../models/bitcoin-rpc/IBlockTemplate';
import { IMiningInfo } from '../models/bitcoin-rpc/IMiningInfo';
@Injectable()
export class BitcoinRpcService {
@@ -25,10 +23,8 @@ export class BitcoinRpcService {
this.client = new RPCClient({ url, port, timeout, user, pass });
console.log('Bitcoin RPC connected');
// Maybe use ZeroMQ ?
setInterval(async () => {
const miningInfo = await this.getMiningInfo();
@@ -37,16 +33,12 @@ export class BitcoinRpcService {
this._newBlock$.next(miningInfo);
this.blockHeight = miningInfo.blocks;
}
}, 500);
}
public async getBlockTemplate(): Promise<IBlockTemplate> {
const result: IBlockTemplate = await this.client.getblocktemplate({