Veil-Project / veil

Veil-Project
MIT License
117 stars 91 forks source link

[RPC] listaddresses doesn't include mining addresses #863

Closed CaveSpectre11 closed 1 year ago

CaveSpectre11 commented 3 years ago

Need to look into the changes of listaddresses and likely add capability to scan through the mining addresses that are in the wallet.

Rock-N-Troll commented 3 years ago

It looks like there's a line in the listaddresses command:

// Only get basecoin and stealth addresses
        if (!((item.first.type() == typeid(WitnessV0KeyHash)) ||
              (item.first.type() == typeid(CStealthAddress)))) continue;

which is strange because the code is already built to handle CStealthAddress a few lines below:

if (item.first.type() == typeid(CStealthAddress)) {

so it looks like it was removed intentionally. I suspect just removing it from the continue block would fix it, but think there's some reason why it was removed in the first place.

Any input would be appreciated as it seems like the fix is simple

(I'm wrong....still investigating. stealth addresses are sv, basecoin are bv, mining starts with V which is not included)

CaveSpectre11 commented 3 years ago

It looks like there's a line in the listaddresses command:

// Only get basecoin and stealth addresses
        if (!((item.first.type() == typeid(WitnessV0KeyHash)) ||
              (item.first.type() == typeid(CStealthAddress)))) continue;

which is strange because the code is already built to handle CStealthAddress a few lines below:

if (item.first.type() == typeid(CStealthAddress)) {

so it looks like it was removed intentionally. I suspect just removing it from the continue block would fix it, but think there's some reason why it was removed in the first place.

Any input would be appreciated as it seems like the fix is simple

Note that this cli command was added in PR #842, and the intent was to give a way to list the stealth addresses; so mining addresses weren't exactly considered; hence the Issue (I think).

The first check was to limit it to stealth and basecoin; the second was to get the information for stealth if stealth, else basecoin. So your PR appears correct to add a 3rd accepted addresstype.

seanPhill commented 1 year ago

This issue is addressed in the merged commit of #911 [RPC] Return mining addresses in list addresses roc command.

(Cleaning up)