Skip to content

msg = "min relay fee not met, 0 < 226 (code 66)"; #127

@Maochengfag

Description

@Maochengfag

I am doing BTC transaction , use BTCTransaction class I just setFee:like this:
BTCTransaction *tx = [[BTCTransaction alloc] init];
long gas = [self caculateFee:fee andAmount:amount andUtxos:txouts];
tx.fee = gas;

  • (long)caculateFee:(NSString *)feeRate andAmount: (long)amount andUtxos:(NSArray )utxos{
    long utxoAmount = 0L;
    long utxoSize = 0L;
    long fee = 0L;
    for (BTCTransactionOutput txout in utxos) {
    utxoSize++;
    if(utxoAmount >= (amount + fee)){
    break;
    }else{
    utxoAmount += txout.value;
    fee = (utxoSize * 148 + 34
    2+10)
    [feeRate longLongValue];
    }
    }
    return fee;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions