MultiChain / multichain-explorer

Web-based explorer for MultiChain blockchains
GNU Affero General Public License v3.0
177 stars 140 forks source link

native currency not show with "getaddressbalances" function in non-owned wallets #36

Open agramajo opened 6 years ago

agramajo commented 6 years ago

Hi,

With this approach in code (use getaddressbalances), we can not see the balance in non-owned wallet.

https://github.com/MultiChain/multichain-explorer/blob/4f0749d4c6321335fc485d34f1b4044b7f8bdf3e/Mce/abe.py#L1854-L1874 )

Check this:

node1 (seed and with multichain explorer):

chain1: getaddressbalances 1BjxiATbrwntty1PQx95kk3fcV6FKNWAq4y3e7
{"method":"getaddressbalances","params":["1BjxiATbrwntty1PQx95kk3fcV6FKNWAq4y3e7"],"id":1,"chain_name":"chain1"}

[
    {
        "assetref" : "",
        "qty" : 0.00000000,
        "raw" : 0
    }
]

chain1: getaddresses                                             
{"method":"getaddresses","params":[],"id":1,"chain_name":"chain1"}

[
    "1DMsbx13P5iP42DLmdPiWmVCwRNQDPSo13b2PP"
]

chain1: getaddressbalances 1DMsbx13P5iP42DLmdPiWmVCwRNQDPSo13b2PP
{"method":"getaddressbalances","params":["1DMsbx13P5iP42DLmdPiWmVCwRNQDPSo13b2PP"],"id":1,"chain_name":"chain1"}

[
    {
        "assetref" : "",
        "qty" : 1000015.00000000,
        "raw" : 100001500000000
    }
]

Explorer address 1DMsbx13P5iP42DLmdPiWmVCwRNQDPSo13b2PP

image

node2: with address 1BjxiATbrwntty1PQx95kk3fcV6FKNWAq4y3e7

chain1: getaddresses           
{"method":"getaddresses","params":[],"id":1,"chain_name":"chain1"}

[
    "1BjxiATbrwntty1PQx95kk3fcV6FKNWAq4y3e7"
]
chain1: getaddressbalances 1BjxiATbrwntty1PQx95kk3fcV6FKNWAq4y3e7
{"method":"getaddressbalances","params":["1BjxiATbrwntty1PQx95kk3fcV6FKNWAq4y3e7"],"id":1,"chain_name":"chain1"}

[
    {
        "assetref" : "",
        "qty" : 12.00000000,
        "raw" : 1200000000
    }
]

Explorer address 1BjxiATbrwntty1PQx95kk3fcV6FKNWAq4y3e7

image

Do you know if exists a better solution? I am starting to dig in the code to understand and try to fix it.

Regards and thanks for Multichain.