Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't offline multisig with complex transaction #3260

Open
rink1969 opened this issue Oct 31, 2024 · 2 comments
Open

can't offline multisig with complex transaction #3260

rink1969 opened this issue Oct 31, 2024 · 2 comments
Assignees
Labels

Comments

@rink1969
Copy link

Topic Type

User Experience

Detail of the issue

应用场景中需要构造一个比较复杂的交易,inputs里面既有多签,又有其他的lockscript。
将交易转换成offline交易,用Neuron进行离线多签(提前已经配置好多签地址),报签名失败。

之前用简单的转账交易试过是ok的,所以怀疑是交易input里包含其他lockscript的原因。
查看代码,大概确认了这个想法,似乎Neuron离线多签的时候会处理所有的input,如果有问题都会报错。

尝试fork代码并做了以下修改:

--- a/packages/neuron-wallet/src/services/transaction-sender.ts
+++ b/packages/neuron-wallet/src/services/transaction-sender.ts
@@ -26,7 +26,6 @@ import {
   CapacityNotEnoughForChange,
   CapacityNotEnoughForChangeByTransfer,
   CellIsNotYetLive,
-  MultisigConfigNeedError,
   NoMatchAddressForSign,
   SignTransactionFailed,
   TransactionIsNotCommittedYet,
@@ -330,7 +329,9 @@ export default class TransactionSender {
     for (const lockHash of lockHashes) {
       const multisigConfig = multisigConfigMap[lockHash]
       if (!multisigConfig) {
-        throw new MultisigConfigNeedError()
+        // complex transaction has other lock
+        logger.warn('met unknown lock, ignore it!', lockHash)
+        continue
       }
       const [privateKey, blake160] = findPrivateKeyAndBlake160(multisigConfig.blake160s, tx.signatures?.[lockHash])

在找不到对应的 multisigConfig 时直接忽略这个input,测试是ok的,可以顺利完成签名并导出签名后的交易。

当然这个修改比较简单粗暴,而且问题也不只是这里,感觉单签的时候如果交易的input里有其他的lock,应该也会有一样的问题

bundled-ckb.log

No response

bundled-ckb-light-mainnet.log

No response

main.log

No response

status.log

No response

@Keith-CY
Copy link
Collaborator

@Danie0918 请跟进一下这个需求

@Danie0918
Copy link
Collaborator

@Danie0918 请跟进一下这个需求

好的,我会将它加入到我们的需求池

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants