]> git.codecow.com Git - libnemo.git/commitdiff
Use frontier for potential Ledger signature when signing from block.
authorChris Duncan <chris@zoso.dev>
Wed, 20 Aug 2025 20:32:11 +0000 (13:32 -0700)
committerChris Duncan <chris@zoso.dev>
Wed, 20 Aug 2025 20:32:11 +0000 (13:32 -0700)
src/lib/block.ts

index 2e0da011cfdc8fb05d4501c365308951f37b570e..50f649744df607551b54d4dfe0a70c6490af0d53 100644 (file)
@@ -422,9 +422,11 @@ export class Block {
                                if (typeof input === 'string' && /^[A-F0-9]{64}$/i.test(input)) {
                                        const signature = await NanoNaCl.detached(this.#hash(), hex.toBytes(input))
                                        this.signature = bytes.toHex(signature)
-                               } else if (input instanceof Wallet && typeof index === 'number') {
+                               } else if (input instanceof Wallet && typeof index === 'number'
+                                       && (frontier === undefined || frontier instanceof Block)
+                               ) {
                                        const wallet = input
-                                       await wallet.sign(index, this)
+                                       await wallet.sign(index, this, frontier)
                                } else {
                                        throw new TypeError('Invalid input for block signature')
                                }