Skip to content

Possible conditional error on line 22 in blackjack.js #37

@miroosama

Description

@miroosama

I was running into an issue passing the conditional on line 22 of blackjack.js

if ((inAccum + inputValue) > (outAccum + fee + threshold)) continue

despite having a greater sum of inAccum + inputValue than outAccum + fee + threshold

I changed the conditional to

if ((inAccum + inputValue) > (outAccum + fee + threshold)){

and was able to generate the correct response of hitting

return utils.finalize(inputs, outputs, feeRate)

The original error would read cannot forEach on inputs value of Undefined because I was only being returned a fee from the else

return { fee: feeRate * bytesAccum }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions