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

RPC: Add ancestor{count,size,fees} to listunspent output #12677

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
@luke-jr
Member

luke-jr commented Mar 12, 2018

Requested by a user

@practicalswift

This comment has been minimized.

Member

practicalswift commented Mar 12, 2018

Concept ACK

@promag

Could add tests for new fields. Also, help message could state when these are in the response.

@@ -3056,6 +3060,15 @@ UniValue listunspent(const JSONRPCRequest& request)
entry.pushKV("scriptPubKey", HexStr(scriptPubKey.begin(), scriptPubKey.end()));
entry.pushKV("amount", ValueFromAmount(out.tx->tx->vout[out.i].nValue));
entry.pushKV("confirmations", out.nDepth);
if (out.nDepth) {
LOCK(mempool.cs);
const auto it = mempool.mapTx.find(out.tx->GetHash());

This comment has been minimized.

@promag

promag Mar 12, 2018

Member

Not sure if this is correct, if out.nDepth > 0 then out.tx should not be in the mempool right? Or should the condition be out.nDepth == 0?

entry.pushKV("ancestorsize", it->GetSizeWithAncestors());
entry.pushKV("ancestorfees", it->GetModFeesWithAncestors());
}
}

This comment has been minimized.

@conscott

conscott Mar 13, 2018

Contributor

Should this also add the no ancestor case?

{
    ...
    "ancestorcount": 0,
    "ancestorsize": 0,
    "ancestorfees": 0,
    ....
}

If the aim is to avoid adding unnecessary size to responses, then the help message above might mention these fields will only print if ancestors exist.

@BitcoinGeek

This comment has been minimized.

BitcoinGeek commented Mar 13, 2018

Thank you Luke for taking it into consideration and adding it !

@MeshCollider

This comment has been minimized.

Member

MeshCollider commented Mar 13, 2018

Concept ACK, perhaps it'd be cleaner to sub-object them like you put in the title of the PR

@sipa

This comment has been minimized.

Member

sipa commented Mar 17, 2018

Concept ACK

@promag

This comment has been minimized.

Member

promag commented May 3, 2018

@luke-jr is this still relevant? There are a couple of suggestions above and it's missing test(s) update.

@achow101

This comment has been minimized.

Member

achow101 commented Jul 9, 2018

utACK daeb431

@MarcoFalke

This comment has been minimized.

Member

MarcoFalke commented Jul 10, 2018

@promag Indeed, needs a trivial test where they are all different from 0

@DrahtBot

This comment has been minimized.

Contributor

DrahtBot commented Jul 21, 2018

The last travis run for this pull request was 112 days ago and is thus outdated. To trigger a fresh travis build, this pull request should be closed and re-opened.
@DrahtBot

This comment has been minimized.

Contributor

DrahtBot commented Oct 20, 2018

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #14481 (Add P2SH-P2WSH support to listunspent RPC by MeshCollider)
  • #9152 (Wallet/RPC: sweepprivkeys method to scan UTXO set and send to local wallet by luke-jr)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@DrahtBot

This comment has been minimized.

Contributor

DrahtBot commented Nov 5, 2018

Needs rebase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment