2

我有一个离线签名代码,我需要将摘要或二进制 blob 传递给该代码以获取签名。看起来我生成的摘要不正确,因为当我尝试提交序列化签名时,它抱怨“本地检查失败:签名无效”。以下是步骤,我正在执行生成摘要/二进制 blob

  STTx noopTx(ttPAYMENT,
    [&](auto& obj)
{
    // General transaction fields
    obj[sfAccount] = id;
    obj[sfFee] = STAmount(XRPAmount(fee));
    obj[sfFlags] = tfFullyCanonicalSig;
    obj[sfSequence] = sequence;
    obj[sfSigningPubKey] = pub_key.slice();
    // Payment-specific fields
    obj[sfAmount] = STAmount(XRPAmount(amount));
    obj[sfDestination] = *to_account;
    obj[sfSendMax] = STAmount(XRPAmount(amount));
});
ripple::uint256 hash256 = noopTx.getSigningHash();

输出:0861970E8AAC8539600E2FB9169774F303A29C3B8CA98FF9206C9B958C681ACF

如果我缺少任何需要的字段,请有人告诉我?

4

0 回答 0