// SPDX-FileCopyrightText: 2024 Chris Duncan <chris@zoso.dev>
// SPDX-License-Identifier: GPL-3.0-or-later
-import { BURN_ADDRESS, PREAMBLE } from './constants.js'
+import { BURN_ADDRESS, PREAMBLE, THRESHOLD_RECEIVE, THRESHOLD_SEND } from './constants.js'
import { Account } from './account.js'
import { Blake2b } from './blake2b.js'
import { bytes, dec, hex } from './convert.js'
async pow (): Promise<void> {
const pool = new Pool(Pow)
const data = {
- "hash": this.previous
+ "hash": this.previous,
+ "threshold": (this instanceof SendBlock || this instanceof ChangeBlock)
+ ? THRESHOLD_SEND
+ : THRESHOLD_RECEIVE
}
const [{ work }] = await pool.work('converge', [data])
this.work = work
export const SEED_LENGTH_BIP44 = 128
export const SEED_LENGTH_BLAKE2B = 64
export const SLIP10_ED25519 = 'ed25519 seed'
+export const THRESHOLD_RECEIVE = '0xfffffe'
+export const THRESHOLD_SEND = '0xfffffff8'
export const XNO = 'ΣΎ'
export const LEDGER_STATUS_CODES: { [key: number]: string } = Object.freeze({
import { Blake2b } from './blake2b.js'
const p = () => {
- const NONCE_BYTES = 8
- const RECEIVE_THRESHOLD = '0xfffffe'
const SEND_THRESHOLD = '0xfffffff8'
-
/**
* Listens for messages from a calling function.
*/